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

Side by Side Diff: webrtc/modules/video_coding/main/source/codec_database.h

Issue 1428293003: Add VideoCodec::PreferDecodeLate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed SetExpectedRendererDelay bug Created 5 years, 1 month 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
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 18 matching lines...) Expand all
29 bool require_key_frame); 29 bool require_key_frame);
30 30
31 rtc::scoped_ptr<VideoCodec> settings; 31 rtc::scoped_ptr<VideoCodec> settings;
32 int number_of_cores; 32 int number_of_cores;
33 bool require_key_frame; 33 bool require_key_frame;
34 }; 34 };
35 35
36 struct VCMExtDecoderMapItem { 36 struct VCMExtDecoderMapItem {
37 public: 37 public:
38 VCMExtDecoderMapItem(VideoDecoder* external_decoder_instance, 38 VCMExtDecoderMapItem(VideoDecoder* external_decoder_instance,
39 uint8_t payload_type, 39 uint8_t payload_type);
40 bool internal_render_timing);
41 40
42 uint8_t payload_type; 41 uint8_t payload_type;
43 VideoDecoder* external_decoder_instance; 42 VideoDecoder* external_decoder_instance;
44 bool internal_render_timing;
45 }; 43 };
46 44
47 class VCMCodecDataBase { 45 class VCMCodecDataBase {
48 public: 46 public:
49 explicit VCMCodecDataBase(VideoEncoderRateObserver* encoder_rate_observer); 47 explicit VCMCodecDataBase(VideoEncoderRateObserver* encoder_rate_observer);
50 ~VCMCodecDataBase(); 48 ~VCMCodecDataBase();
51 49
52 // Sender Side 50 // Sender Side
53 // Returns the number of supported codecs (or -1 in case of error). 51 // Returns the number of supported codecs (or -1 in case of error).
54 static int NumberOfCodecs(); 52 static int NumberOfCodecs();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 92
95 bool SetPeriodicKeyFrames(bool enable); 93 bool SetPeriodicKeyFrames(bool enable);
96 94
97 // Receiver Side 95 // Receiver Side
98 void ResetReceiver(); 96 void ResetReceiver();
99 97
100 // Deregisters an external decoder object specified by |payload_type|. 98 // Deregisters an external decoder object specified by |payload_type|.
101 bool DeregisterExternalDecoder(uint8_t payload_type); 99 bool DeregisterExternalDecoder(uint8_t payload_type);
102 100
103 // Registers an external decoder object to the payload type |payload_type|. 101 // Registers an external decoder object to the payload type |payload_type|.
104 // |internal_render_timing| is set to true if the |external_decoder| has
105 // built in rendering which is able to obey the render timestamps of the
106 // encoded frames.
107 bool RegisterExternalDecoder(VideoDecoder* external_decoder, 102 bool RegisterExternalDecoder(VideoDecoder* external_decoder,
108 uint8_t payload_type, 103 uint8_t payload_type);
109 bool internal_render_timing);
110 104
111 bool DecoderRegistered() const; 105 bool DecoderRegistered() const;
112 106
113 bool RegisterReceiveCodec(const VideoCodec* receive_codec, 107 bool RegisterReceiveCodec(const VideoCodec* receive_codec,
114 int number_of_cores, 108 int number_of_cores,
115 bool require_key_frame); 109 bool require_key_frame);
116 110
117 bool DeregisterReceiveCodec(uint8_t payload_type); 111 bool DeregisterReceiveCodec(uint8_t payload_type);
118 112
119 // Get current receive side codec. Relevant for internal codecs only. 113 // Get current receive side codec. Relevant for internal codecs only.
120 bool ReceiveCodec(VideoCodec* current_receive_codec) const; 114 bool ReceiveCodec(VideoCodec* current_receive_codec) const;
121 115
122 // Get current receive side codec type. Relevant for internal codecs only. 116 // Get current receive side codec type. Relevant for internal codecs only.
123 VideoCodecType ReceiveCodec() const; 117 VideoCodecType ReceiveCodec() const;
124 118
125 // Returns a decoder specified by |payload_type|. The decoded frame callback 119 // Returns a decoder specified by |payload_type|. The decoded frame callback
126 // of the encoder is set to |decoded_frame_callback|. If no such decoder 120 // of the encoder is set to |decoded_frame_callback|. If no such decoder
127 // already exists an instance will be created and initialized. 121 // already exists an instance will be created and initialized.
128 // NULL is returned if no encoder with the specified payload type was found 122 // NULL is returned if no encoder with the specified payload type was found
129 // and the function failed to create one. 123 // and the function failed to create one.
130 VCMGenericDecoder* GetDecoder( 124 VCMGenericDecoder* GetDecoder(
131 uint8_t payload_type, VCMDecodedFrameCallback* decoded_frame_callback); 125 uint8_t payload_type, VCMDecodedFrameCallback* decoded_frame_callback);
132 126
133 // Deletes the memory of the decoder instance |decoder|. Used to delete 127 // Deletes the memory of the decoder instance |decoder|. Used to delete
134 // deep copies returned by CreateDecoderCopy(). 128 // deep copies returned by CreateDecoderCopy().
135 void ReleaseDecoder(VCMGenericDecoder* decoder) const; 129 void ReleaseDecoder(VCMGenericDecoder* decoder) const;
136 130
137 // Returns true if the currently active decoder supports render scheduling, 131 // Returns true if the currently active decoder only have one output buffer.
138 // that is, it is able to render frames according to the render timestamp of 132 // That means that frames must be decoded near the render times stamp since
139 // the encoded frames. 133 // multiple frames can not be decoded ahead of time.
140 bool SupportsRenderScheduling() const; 134 bool HasOnlyOneOutputBuffer() const;
141 135
142 bool MatchesCurrentResolution(int width, int height) const; 136 bool MatchesCurrentResolution(int width, int height) const;
143 137
144 private: 138 private:
145 typedef std::map<uint8_t, VCMDecoderMapItem*> DecoderMap; 139 typedef std::map<uint8_t, VCMDecoderMapItem*> DecoderMap;
146 typedef std::map<uint8_t, VCMExtDecoderMapItem*> ExternalDecoderMap; 140 typedef std::map<uint8_t, VCMExtDecoderMapItem*> ExternalDecoderMap;
147 141
148 VCMGenericDecoder* CreateAndInitDecoder(uint8_t payload_type, 142 VCMGenericDecoder* CreateAndInitDecoder(uint8_t payload_type,
149 VideoCodec* new_codec) const; 143 VideoCodec* new_codec) const;
150 144
(...skipping 23 matching lines...) Expand all
174 VideoEncoderRateObserver* const encoder_rate_observer_; 168 VideoEncoderRateObserver* const encoder_rate_observer_;
175 rtc::scoped_ptr<VCMGenericEncoder> ptr_encoder_; 169 rtc::scoped_ptr<VCMGenericEncoder> ptr_encoder_;
176 VCMGenericDecoder* ptr_decoder_; 170 VCMGenericDecoder* ptr_decoder_;
177 DecoderMap dec_map_; 171 DecoderMap dec_map_;
178 ExternalDecoderMap dec_external_map_; 172 ExternalDecoderMap dec_external_map_;
179 }; // VCMCodecDataBase 173 }; // VCMCodecDataBase
180 174
181 } // namespace webrtc 175 } // namespace webrtc
182 176
183 #endif // WEBRTC_MODULES_VIDEO_CODING_MAIN_SOURCE_CODEC_DATABASE_H_ 177 #endif // WEBRTC_MODULES_VIDEO_CODING_MAIN_SOURCE_CODEC_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698