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

Side by Side Diff: media/gpu/android_video_decode_accelerator.h

Issue 2365103002: Send the h264 SPS and PPS configuration parameters to AVDA (Closed)
Patch Set: Fix array init syntax Created 4 years, 2 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
6 #define MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 6 #define MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 // Initial coded size. The actual size might change at any time, so this 119 // Initial coded size. The actual size might change at any time, so this
120 // is only a hint. 120 // is only a hint.
121 gfx::Size initial_expected_coded_size_; 121 gfx::Size initial_expected_coded_size_;
122 122
123 // Should we allow MediaCodec to autodetect the codec type (true), or 123 // Should we allow MediaCodec to autodetect the codec type (true), or
124 // select a software decoder manually (false). This is because fallback to 124 // select a software decoder manually (false). This is because fallback to
125 // software when autodetecting can sometimes hang mediaserver. 125 // software when autodetecting can sometimes hang mediaserver.
126 bool allow_autodetection_ = false; 126 bool allow_autodetection_ = false;
127 127
128 // Codec specific data (SPS and PPS for H264).
129 std::vector<uint8_t> csd0_;
130 std::vector<uint8_t> csd1_;
131
128 protected: 132 protected:
129 friend class base::RefCountedThreadSafe<CodecConfig>; 133 friend class base::RefCountedThreadSafe<CodecConfig>;
130 virtual ~CodecConfig(); 134 virtual ~CodecConfig();
131 135
132 private: 136 private:
133 DISALLOW_COPY_AND_ASSIGN(CodecConfig); 137 DISALLOW_COPY_AND_ASSIGN(CodecConfig);
134 }; 138 };
135 139
136 // Callback that is called when the SurfaceView becomes available, if it's 140 // Callback that is called when the SurfaceView becomes available, if it's
137 // not during Initialize. |success| is true if it is now available, false 141 // not during Initialize. |success| is true if it is now available, false
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // components need to be reset upon EOS to decode a later stream. Input state 265 // components need to be reset upon EOS to decode a later stream. Input state
262 // (e.g. queued BitstreamBuffers) is not reset, as input following an EOS 266 // (e.g. queued BitstreamBuffers) is not reset, as input following an EOS
263 // is still valid and should be processed. 267 // is still valid and should be processed.
264 void ResetCodecState(); 268 void ResetCodecState();
265 269
266 // Registered to be called when surfaces are being destroyed. If |surface_id| 270 // Registered to be called when surfaces are being destroyed. If |surface_id|
267 // is our surface, we should release the MediaCodec before returning from 271 // is our surface, we should release the MediaCodec before returning from
268 // this. 272 // this.
269 void OnDestroyingSurface(int surface_id); 273 void OnDestroyingSurface(int surface_id);
270 274
275 // Initialize the csd fields of |codec_config_| with parameters extracted from
276 // |extra_data|.
277 void SetCsd(const std::vector<uint8_t>& extra_data);
278
271 // Indicates if MediaCodec should not be used for software decoding since we 279 // Indicates if MediaCodec should not be used for software decoding since we
272 // have safer versions elsewhere. 280 // have safer versions elsewhere.
273 bool IsMediaCodecSoftwareDecodingForbidden() const; 281 bool IsMediaCodecSoftwareDecodingForbidden() const;
274 282
275 // Used to DCHECK that we are called on the correct thread. 283 // Used to DCHECK that we are called on the correct thread.
276 base::ThreadChecker thread_checker_; 284 base::ThreadChecker thread_checker_;
277 285
278 // To expose client callbacks from VideoDecodeAccelerator. 286 // To expose client callbacks from VideoDecodeAccelerator.
279 Client* client_; 287 Client* client_;
280 288
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 393
386 // WeakPtrFactory for posting tasks back to |this|. 394 // WeakPtrFactory for posting tasks back to |this|.
387 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_; 395 base::WeakPtrFactory<AndroidVideoDecodeAccelerator> weak_this_factory_;
388 396
389 friend class AndroidVideoDecodeAcceleratorTest; 397 friend class AndroidVideoDecodeAcceleratorTest;
390 }; 398 };
391 399
392 } // namespace media 400 } // namespace media
393 401
394 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_ 402 #endif // MEDIA_GPU_ANDROID_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698