OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 * |
| 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 |
| 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ |
| 10 |
| 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_ALPHA_INCLUDE_ALPHA_DECODER_ADAPTER_H
_ |
| 12 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_ALPHA_INCLUDE_ALPHA_DECODER_ADAPTER_H
_ |
| 13 |
| 14 #include <map> |
| 15 #include <memory> |
| 16 #include <vector> |
| 17 |
| 18 #include "api/video_codecs/video_decoder.h" |
| 19 #include "media/engine/webrtcvideodecoderfactory.h" |
| 20 #include "modules/video_coding/codecs/stereo/include/stereo_encoder_adapter.h" |
| 21 |
| 22 namespace webrtc { |
| 23 |
| 24 class StereoDecoderAdapter : public VideoDecoder { |
| 25 public: |
| 26 explicit StereoDecoderAdapter(cricket::WebRtcVideoDecoderFactory* factory); |
| 27 virtual ~StereoDecoderAdapter(); |
| 28 |
| 29 // Implements VideoDecoder |
| 30 int32_t InitDecode(const VideoCodec* codec_settings, |
| 31 int32_t number_of_cores) override; |
| 32 int32_t Decode(const EncodedImage& input_image, |
| 33 bool missing_frames, |
| 34 const RTPFragmentationHeader* fragmentation, |
| 35 const CodecSpecificInfo* codec_specific_info = NULL, |
| 36 int64_t render_time_ms = -1) override; |
| 37 int32_t RegisterDecodeCompleteCallback( |
| 38 DecodedImageCallback* callback) override; |
| 39 int32_t Release() override; |
| 40 |
| 41 void Decoded(StereoCodecStream stream_idx, |
| 42 VideoFrame& decoded_image, |
| 43 rtc::Optional<int32_t> decode_time_ms, |
| 44 rtc::Optional<uint8_t> qp); |
| 45 |
| 46 private: |
| 47 // Wrapper class that redirects Decoded() calls. |
| 48 class AdapterDecodedImageCallback; |
| 49 |
| 50 // Holds the decoded image output of a frame. |
| 51 struct DecodedImageData; |
| 52 |
| 53 void MergeDecodedImages(VideoFrame& decoded_image, |
| 54 const rtc::Optional<int32_t>& decode_time_ms, |
| 55 const rtc::Optional<uint8_t>& qp, |
| 56 VideoFrame& stereo_decoded_image, |
| 57 const rtc::Optional<int32_t>& stereo_decode_time_ms, |
| 58 const rtc::Optional<uint8_t>& stereo_qp); |
| 59 |
| 60 cricket::WebRtcVideoDecoderFactory* const factory_; |
| 61 std::vector<std::unique_ptr<VideoDecoder>> decoders_; |
| 62 std::vector<std::unique_ptr<AdapterDecodedImageCallback>> adapter_callbacks_; |
| 63 DecodedImageCallback* decoded_complete_callback_; |
| 64 |
| 65 // Holds YUV or AXX decode output of a frame that is identified by timestamp. |
| 66 std::map<uint32_t /* timestamp */, DecodedImageData> decoded_data_; |
| 67 }; |
| 68 |
| 69 } // namespace webrtc |
| 70 |
| 71 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_ALPHA_INCLUDE_ALPHA_DECODER_ADAPTE
R_H_ |
OLD | NEW |