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

Side by Side Diff: media/filters/gpu_video_decoder.h

Issue 20632002: Add media::VideoEncodeAccelerator with WebRTC integration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: d8fba33b Address comments, minus RTCVideoEncoder and media::VEA Created 7 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_FILTERS_GPU_VIDEO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "media/base/pipeline_status.h" 15 #include "media/base/pipeline_status.h"
16 #include "media/base/video_decoder.h" 16 #include "media/base/video_decoder.h"
17 #include "media/video/video_decode_accelerator.h" 17 #include "media/video/video_decode_accelerator.h"
18 18
19 template <class T> class scoped_refptr; 19 template <class T> class scoped_refptr;
20 20
21 namespace base { 21 namespace base {
22 class MessageLoopProxy; 22 class MessageLoopProxy;
23 class SharedMemory; 23 class SharedMemory;
24 } 24 }
25 25
26 namespace media { 26 namespace media {
27 27
28 class DecoderBuffer; 28 class DecoderBuffer;
29 class GpuVideoDecoderFactories; 29 class GpuVideoAcceleratorFactories;
30 30
31 // GPU-accelerated video decoder implementation. Relies on 31 // GPU-accelerated video decoder implementation. Relies on
32 // AcceleratedVideoDecoderMsg_Decode and friends. 32 // AcceleratedVideoDecoderMsg_Decode and friends.
33 class MEDIA_EXPORT GpuVideoDecoder 33 class MEDIA_EXPORT GpuVideoDecoder
34 : public VideoDecoder, 34 : public VideoDecoder,
35 public VideoDecodeAccelerator::Client { 35 public VideoDecodeAccelerator::Client {
36 public: 36 public:
37 // The message loop of |factories| will be saved to |gvd_loop_proxy_|. 37 // The message loop of |factories| will be saved to |gvd_loop_proxy_|.
38 explicit GpuVideoDecoder( 38 explicit GpuVideoDecoder(
39 const scoped_refptr<GpuVideoDecoderFactories>& factories); 39 const scoped_refptr<GpuVideoAcceleratorFactories>& factories);
40 40
41 // VideoDecoder implementation. 41 // VideoDecoder implementation.
42 virtual void Initialize(const VideoDecoderConfig& config, 42 virtual void Initialize(const VideoDecoderConfig& config,
43 const PipelineStatusCB& status_cb) OVERRIDE; 43 const PipelineStatusCB& status_cb) OVERRIDE;
44 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, 44 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer,
45 const ReadCB& read_cb) OVERRIDE; 45 const ReadCB& read_cb) OVERRIDE;
46 virtual void Reset(const base::Closure& closure) OVERRIDE; 46 virtual void Reset(const base::Closure& closure) OVERRIDE;
47 virtual void Stop(const base::Closure& closure) OVERRIDE; 47 virtual void Stop(const base::Closure& closure) OVERRIDE;
48 virtual bool HasAlpha() const OVERRIDE; 48 virtual bool HasAlpha() const OVERRIDE;
49 virtual bool NeedsBitstreamConversion() const OVERRIDE; 49 virtual bool NeedsBitstreamConversion() const OVERRIDE;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 void DestroyTextures(); 111 void DestroyTextures();
112 112
113 bool needs_bitstream_conversion_; 113 bool needs_bitstream_conversion_;
114 114
115 // Message loop which this class and |factories_| run on. 115 // Message loop which this class and |factories_| run on.
116 scoped_refptr<base::MessageLoopProxy> gvd_loop_proxy_; 116 scoped_refptr<base::MessageLoopProxy> gvd_loop_proxy_;
117 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_; 117 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_;
118 base::WeakPtr<GpuVideoDecoder> weak_this_; 118 base::WeakPtr<GpuVideoDecoder> weak_this_;
119 119
120 scoped_refptr<GpuVideoDecoderFactories> factories_; 120 scoped_refptr<GpuVideoAcceleratorFactories> factories_;
121 121
122 // Populated during Initialize() (on success) and unchanged until an error 122 // Populated during Initialize() (on success) and unchanged until an error
123 // occurs. 123 // occurs.
124 scoped_ptr<VideoDecodeAccelerator> vda_; 124 scoped_ptr<VideoDecodeAccelerator> vda_;
125 125
126 // Callbacks that are !is_null() only during their respective operation being 126 // Callbacks that are !is_null() only during their respective operation being
127 // asynchronously executed. 127 // asynchronously executed.
128 ReadCB pending_read_cb_; 128 ReadCB pending_read_cb_;
129 base::Closure pending_reset_cb_; 129 base::Closure pending_reset_cb_;
130 130
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // Set during ProvidePictureBuffers(), used for checking and implementing 178 // Set during ProvidePictureBuffers(), used for checking and implementing
179 // HasAvailableOutputFrames(). 179 // HasAvailableOutputFrames().
180 int available_pictures_; 180 int available_pictures_;
181 181
182 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); 182 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder);
183 }; 183 };
184 184
185 } // namespace media 185 } // namespace media
186 186
187 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 187 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698