webrtc_m130/webrtc/modules/video_coding/h264_sps_pps_tracker.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.4 KiB
C
Raw Normal View History

/*
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_
#define WEBRTC_MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_
#include <cstdint>
#include <map>
#include <memory>
#include <vector>
#include "webrtc/modules/include/module_common_types.h"
namespace webrtc {
class VCMPacket;
namespace video_coding {
class H264SpsPpsTracker {
public:
enum PacketAction { kInsert, kDrop, kRequestKeyframe };
PacketAction CopyAndFixBitstream(VCMPacket* packet);
Revert of H264SpsPpsTracker.InsertSpsPpsNalus() should accept Nalus with header. (patchset #3 id:40001 of https://codereview.webrtc.org/2638933002/ ) Reason for revert: Triggers leak on Linux memcheck (non-default trybot): ### BEGIN MEMORY TOOL REPORT (error hash=#0112A395AF2326BC#) Command: ../Release/./modules_unittests --isolated-script-test-output=/b/s/w/ioUlJCnu/output.json --isolated-script-test-chartjson-output=/b/s/w/ioUlJCnu/chartjson-output.json --gtest_filter=-CommonFormats/AudioProcessingTest* Leak_DefinitelyLost 45 bytes in 1 blocks are definitely lost in loss record 118 of 277 operator new[](unsigned long) (m_replacemalloc/vg_replace_malloc.c:363) webrtc::video_coding::H264SpsPpsTracker::CopyAndFixBitstream(webrtc::VCMPacket*) (/b/s/w/irJgAGsR/out/Release/modules_unittests) webrtc::video_coding::TestH264SpsPpsTracker_SpsPpsOutOfBand_Test::TestBody() (/b/s/w/irJgAGsR/out/Release/modules_unittests) Suppression (error hash=#0112A395AF2326BC#): For more info on using suppressions see http://dev.chromium.org/developers/tree-sheriffs/sheriff-details-chromium/memory-sheriff#TOC-Suppressing-memory-reports { <insert_a_suppression_name_here> Memcheck:Leak fun:_Zna* fun:_ZN6webrtc12video_coding17H264SpsPpsTracker19CopyAndFixBitstreamEPNS_9VCMPacketE fun:_ZN6webrtc12video_coding42TestH264SpsPpsTracker_SpsPpsOutOfBand_Test8TestBodyEv } ### END MEMORY TOOL REPORT (error hash=#0112A395AF2326BC#) Original issue's description: > H264SpsPpsTracker.InsertSpsPpsNalus() should accept Nalus with header. > > - Changed method name to clarify that entire Nalus are expected. > - Added unit test code. > - Adjusted InsetSpsPpsNalus() implementation to above requirement. > > BUG=webrtc:5948 > > Review-Url: https://codereview.webrtc.org/2638933002 > Cr-Commit-Position: refs/heads/master@{#16221} > Committed: https://chromium.googlesource.com/external/webrtc/+/f53d7374cfa59440f777729d3a0b7dd39830d6ec TBR=philipel@webrtc.org,sprang@webrtc.org,johan@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:5948 Review-Url: https://codereview.webrtc.org/2649113003 Cr-Commit-Position: refs/heads/master@{#16225}
2017-01-23 20:16:58 -08:00
void InsertSpsPps(const std::vector<uint8_t>& sps,
const std::vector<uint8_t>& pps);
private:
struct PpsInfo {
int sps_id = -1;
size_t size = 0;
std::unique_ptr<uint8_t[]> data;
};
struct SpsInfo {
size_t size = 0;
std::unique_ptr<uint8_t[]> data;
};
std::map<uint32_t, PpsInfo> pps_data_;
std::map<uint32_t, SpsInfo> sps_data_;
};
} // namespace video_coding
} // namespace webrtc
#endif // WEBRTC_MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_