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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 int32_t RegisterDecodeCompleteCallback( | 45 int32_t RegisterDecodeCompleteCallback( |
46 DecodedImageCallback* callback) override; | 46 DecodedImageCallback* callback) override; |
47 | 47 |
48 // |missing_frames|, |fragmentation| and |render_time_ms| are ignored. | 48 // |missing_frames|, |fragmentation| and |render_time_ms| are ignored. |
49 int32_t Decode(const EncodedImage& input_image, | 49 int32_t Decode(const EncodedImage& input_image, |
50 bool /*missing_frames*/, | 50 bool /*missing_frames*/, |
51 const RTPFragmentationHeader* /*fragmentation*/, | 51 const RTPFragmentationHeader* /*fragmentation*/, |
52 const CodecSpecificInfo* codec_specific_info = nullptr, | 52 const CodecSpecificInfo* codec_specific_info = nullptr, |
53 int64_t render_time_ms = -1) override; | 53 int64_t render_time_ms = -1) override; |
54 | 54 |
| 55 const char* ImplementationName() const override; |
| 56 |
55 private: | 57 private: |
56 // Called by FFmpeg when it needs a frame buffer to store decoded frames in. | 58 // Called by FFmpeg when it needs a frame buffer to store decoded frames in. |
57 // The |VideoFrame| returned by FFmpeg at |Decode| originate from here. Their | 59 // The |VideoFrame| returned by FFmpeg at |Decode| originate from here. Their |
58 // buffers are reference counted and freed by FFmpeg using |AVFreeBuffer2|. | 60 // buffers are reference counted and freed by FFmpeg using |AVFreeBuffer2|. |
59 static int AVGetBuffer2( | 61 static int AVGetBuffer2( |
60 AVCodecContext* context, AVFrame* av_frame, int flags); | 62 AVCodecContext* context, AVFrame* av_frame, int flags); |
61 // Called by FFmpeg when it is done with a video frame, see |AVGetBuffer2|. | 63 // Called by FFmpeg when it is done with a video frame, see |AVGetBuffer2|. |
62 static void AVFreeBuffer2(void* opaque, uint8_t* data); | 64 static void AVFreeBuffer2(void* opaque, uint8_t* data); |
63 | 65 |
64 bool IsInitialized() const; | 66 bool IsInitialized() const; |
65 | 67 |
66 // Reports statistics with histograms. | 68 // Reports statistics with histograms. |
67 void ReportInit(); | 69 void ReportInit(); |
68 void ReportError(); | 70 void ReportError(); |
69 | 71 |
70 I420BufferPool pool_; | 72 I420BufferPool pool_; |
71 std::unique_ptr<AVCodecContext, AVCodecContextDeleter> av_context_; | 73 std::unique_ptr<AVCodecContext, AVCodecContextDeleter> av_context_; |
72 std::unique_ptr<AVFrame, AVFrameDeleter> av_frame_; | 74 std::unique_ptr<AVFrame, AVFrameDeleter> av_frame_; |
73 | 75 |
74 DecodedImageCallback* decoded_image_callback_; | 76 DecodedImageCallback* decoded_image_callback_; |
75 | 77 |
76 bool has_reported_init_; | 78 bool has_reported_init_; |
77 bool has_reported_error_; | 79 bool has_reported_error_; |
78 }; | 80 }; |
79 | 81 |
80 } // namespace webrtc | 82 } // namespace webrtc |
81 | 83 |
82 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_ | 84 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_ |
OLD | NEW |