OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 * | 9 * |
10 */ | 10 */ |
(...skipping 26 matching lines...) Expand all Loading... | |
37 // VideoToolbox decoder. The RTP buffer is in annex b format whereas the sample | 37 // VideoToolbox decoder. The RTP buffer is in annex b format whereas the sample |
38 // buffer is in avcc format. | 38 // buffer is in avcc format. |
39 // If |is_keyframe| is true then |video_format| is ignored since the format will | 39 // If |is_keyframe| is true then |video_format| is ignored since the format will |
40 // be read from the buffer. Otherwise |video_format| must be provided. | 40 // be read from the buffer. Otherwise |video_format| must be provided. |
41 // Caller is responsible for releasing the created sample buffer. | 41 // Caller is responsible for releasing the created sample buffer. |
42 bool H264AnnexBBufferToCMSampleBuffer(const uint8_t* annexb_buffer, | 42 bool H264AnnexBBufferToCMSampleBuffer(const uint8_t* annexb_buffer, |
43 size_t annexb_buffer_size, | 43 size_t annexb_buffer_size, |
44 CMVideoFormatDescriptionRef video_format, | 44 CMVideoFormatDescriptionRef video_format, |
45 CMSampleBufferRef* out_sample_buffer); | 45 CMSampleBufferRef* out_sample_buffer); |
46 | 46 |
47 bool H264AnnexBBufferHasVideoFormatDescription(const uint8_t* annexb_buffer, | |
48 size_t annexb_buffer_size); | |
49 | |
50 CMVideoFormatDescriptionRef CreateVideoFormatDescription( | |
51 const uint8_t* annexb_buffer, | |
52 size_t annexb_buffer_size); | |
stefan-webrtc
2016/03/07 15:00:02
Add unittests for these methods.
tkchin_webrtc
2016/03/08 04:52:09
Done.
| |
53 | |
47 // Helper class for reading NALUs from an RTP Annex B buffer. | 54 // Helper class for reading NALUs from an RTP Annex B buffer. |
48 class AnnexBBufferReader final { | 55 class AnnexBBufferReader final { |
49 public: | 56 public: |
50 AnnexBBufferReader(const uint8_t* annexb_buffer, size_t length); | 57 AnnexBBufferReader(const uint8_t* annexb_buffer, size_t length); |
51 ~AnnexBBufferReader() {} | 58 ~AnnexBBufferReader() {} |
52 AnnexBBufferReader(const AnnexBBufferReader& other) = delete; | 59 AnnexBBufferReader(const AnnexBBufferReader& other) = delete; |
53 void operator=(const AnnexBBufferReader& other) = delete; | 60 void operator=(const AnnexBBufferReader& other) = delete; |
54 | 61 |
55 // Returns a pointer to the beginning of the next NALU slice without the | 62 // Returns a pointer to the beginning of the next NALU slice without the |
56 // header bytes and its length. Returns false if no more slices remain. | 63 // header bytes and its length. Returns false if no more slices remain. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 private: | 97 private: |
91 uint8_t* const start_; | 98 uint8_t* const start_; |
92 size_t offset_; | 99 size_t offset_; |
93 const size_t length_; | 100 const size_t length_; |
94 }; | 101 }; |
95 | 102 |
96 } // namespace webrtc | 103 } // namespace webrtc |
97 | 104 |
98 #endif // defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED) | 105 #endif // defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED) |
99 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_VIDEO_TOOLBOX_NALU_H_ | 106 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_VIDEO_TOOLBOX_NALU_H_ |
OLD | NEW |