| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 class DecodedImageCallback { | 29 class DecodedImageCallback { |
| 30 public: | 30 public: |
| 31 virtual ~DecodedImageCallback() {} | 31 virtual ~DecodedImageCallback() {} |
| 32 | 32 |
| 33 virtual int32_t Decoded(VideoFrame& decodedImage) = 0; | 33 virtual int32_t Decoded(VideoFrame& decodedImage) = 0; |
| 34 // Provides an alternative interface that allows the decoder to specify the | 34 // Provides an alternative interface that allows the decoder to specify the |
| 35 // decode time excluding waiting time for any previous pending frame to | 35 // decode time excluding waiting time for any previous pending frame to |
| 36 // return. This is necessary for breaking positive feedback in the delay | 36 // return. This is necessary for breaking positive feedback in the delay |
| 37 // estimation when the decoder has a single output buffer. | 37 // estimation when the decoder has a single output buffer. |
| 38 // TODO(perkj): Remove default implementation when chromium has been updated. | |
| 39 virtual int32_t Decoded(VideoFrame& decodedImage, int64_t decode_time_ms) { | 38 virtual int32_t Decoded(VideoFrame& decodedImage, int64_t decode_time_ms) { |
| 40 // The default implementation ignores custom decode time value. | 39 // The default implementation ignores custom decode time value. |
| 41 return Decoded(decodedImage); | 40 return Decoded(decodedImage); |
| 42 } | 41 } |
| 42 // TODO(sakal): Remove other implementations when upstream projects have been |
| 43 // updated. |
| 44 virtual void Decoded(VideoFrame& decodedImage, |
| 45 rtc::Optional<int32_t> decode_time_ms, |
| 46 rtc::Optional<uint8_t> qp) { |
| 47 Decoded(decodedImage, |
| 48 decode_time_ms ? static_cast<int32_t>(*decode_time_ms) : -1); |
| 49 } |
| 43 | 50 |
| 44 virtual int32_t ReceivedDecodedReferenceFrame(const uint64_t pictureId) { | 51 virtual int32_t ReceivedDecodedReferenceFrame(const uint64_t pictureId) { |
| 45 return -1; | 52 return -1; |
| 46 } | 53 } |
| 47 | 54 |
| 48 virtual int32_t ReceivedDecodedFrame(const uint64_t pictureId) { return -1; } | 55 virtual int32_t ReceivedDecodedFrame(const uint64_t pictureId) { return -1; } |
| 49 }; | 56 }; |
| 50 | 57 |
| 51 class VideoDecoder { | 58 class VideoDecoder { |
| 52 public: | 59 public: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 70 // That is, it can not decode infinite number of frames before the decoded | 77 // That is, it can not decode infinite number of frames before the decoded |
| 71 // frame is consumed. | 78 // frame is consumed. |
| 72 virtual bool PrefersLateDecoding() const { return true; } | 79 virtual bool PrefersLateDecoding() const { return true; } |
| 73 | 80 |
| 74 virtual const char* ImplementationName() const { return "unknown"; } | 81 virtual const char* ImplementationName() const { return "unknown"; } |
| 75 }; | 82 }; |
| 76 | 83 |
| 77 } // namespace webrtc | 84 } // namespace webrtc |
| 78 | 85 |
| 79 #endif // WEBRTC_VIDEO_DECODER_H_ | 86 #endif // WEBRTC_VIDEO_DECODER_H_ |
| OLD | NEW |