Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(536)

Side by Side Diff: webrtc/modules/video_coding/codecs/stereo/include/stereo_decoder_adapter.h

Issue 2990463002: [EXPERIMENTAL] Generic stereo codec with index header sending merged frames
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 "webrtc/api/video_codecs/video_decoder.h"
19 #include "webrtc/modules/video_coding/codecs/stereo/include/stereo_encoder_adapt er.h"
20
21 namespace webrtc {
22
23 class StereoDecoderAdapter : public VideoDecoder {
24 public:
25 explicit StereoDecoderAdapter(VideoDecoderFactory* factory);
26 virtual ~StereoDecoderAdapter();
27
28 // Implements VideoDecoder
29 int32_t InitDecode(const VideoCodec* codec_settings,
30 int32_t number_of_cores) override;
31 int32_t Decode(const EncodedImage& input_image,
32 bool missing_frames,
33 const RTPFragmentationHeader* fragmentation,
34 const CodecSpecificInfo* codec_specific_info = NULL,
35 int64_t render_time_ms = -1) override;
36 int32_t RegisterDecodeCompleteCallback(
37 DecodedImageCallback* callback) override;
38 int32_t Release() override;
39
40 void Decoded(StereoCodecStream stream_idx,
41 VideoFrame& decoded_image,
42 rtc::Optional<int32_t> decode_time_ms,
43 rtc::Optional<uint8_t> qp);
44
45 private:
46 // Wrapper class that redirects Decoded() calls.
47 class AdapterDecodedImageCallback;
48
49 // Holds the decoded image output of a frame.
50 struct DecodedImageData;
51
52 void MergeDecodedImages(VideoFrame& decoded_image,
53 const rtc::Optional<int32_t>& decode_time_ms,
54 const rtc::Optional<uint8_t>& qp,
55 VideoFrame& stereo_decoded_image,
56 const rtc::Optional<int32_t>& stereo_decode_time_ms,
57 const rtc::Optional<uint8_t>& stereo_qp);
58
59 std::unique_ptr<VideoDecoderFactory> factory_;
60 std::vector<VideoDecoder*> decoders_;
61 std::vector<std::unique_ptr<AdapterDecodedImageCallback>> adapter_callbacks_;
62 DecodedImageCallback* decoded_complete_callback_;
63
64 // Holds YUV or AXX decode output of a frame that is identified by timestamp.
65 std::map<uint32_t /* timestamp */, DecodedImageData> decoded_data_;
66 };
67
68 } // namespace webrtc
69
70 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_ALPHA_INCLUDE_ALPHA_DECODER_ADAPTE R_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698