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

Side by Side Diff: webkit/plugins/ppapi/ppb_video_decoder_impl.h

Issue 6901036: Update VideoDecode PPAPI structs to be consistent with media structures, part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_callback_factory.h" 12 #include "base/memory/scoped_callback_factory.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "ppapi/c/pp_var.h" 14 #include "ppapi/c/pp_var.h"
15 #include "webkit/plugins/ppapi/plugin_delegate.h" 15 #include "webkit/plugins/ppapi/plugin_delegate.h"
16 #include "webkit/plugins/ppapi/resource.h" 16 #include "webkit/plugins/ppapi/resource.h"
17 17
18 union PP_PictureData_Dev; 18 struct PP_Picture_Dev;
19 struct PP_PictureBuffer_Dev;
19 struct PP_VideoDecoderConfig_Dev; 20 struct PP_VideoDecoderConfig_Dev;
20 struct PP_VideoBitstreamBuffer_Dev; 21 struct PP_VideoBitstreamBuffer_Dev;
21 struct PPB_VideoDecoder_Dev; 22 struct PPB_VideoDecoder_Dev;
22 23
23 namespace webkit { 24 namespace webkit {
24 namespace ppapi { 25 namespace ppapi {
25 26
26 class PluginInstance; 27 class PluginInstance;
27 28
28 class PPB_VideoDecoder_Impl : public Resource, 29 class PPB_VideoDecoder_Impl : public Resource,
(...skipping 11 matching lines...) Expand all
40 41
41 // PPB_VideoDecoder implementation. 42 // PPB_VideoDecoder implementation.
42 bool GetConfigs(PP_VideoDecoderConfig_Dev* proto_config, 43 bool GetConfigs(PP_VideoDecoderConfig_Dev* proto_config,
43 PP_VideoDecoderConfig_Dev* matching_configs, 44 PP_VideoDecoderConfig_Dev* matching_configs,
44 int32_t matching_configs_size, 45 int32_t matching_configs_size,
45 int32_t* num_of_matching_configs); 46 int32_t* num_of_matching_configs);
46 bool Init(PP_VideoDecoderConfig_Dev* dec_config); 47 bool Init(PP_VideoDecoderConfig_Dev* dec_config);
47 bool Decode(PP_VideoBitstreamBuffer_Dev* bitstream_buffer, 48 bool Decode(PP_VideoBitstreamBuffer_Dev* bitstream_buffer,
48 PP_CompletionCallback callback); 49 PP_CompletionCallback callback);
49 void AssignPictureBuffer(uint32_t no_of_picture_buffers, 50 void AssignPictureBuffer(uint32_t no_of_picture_buffers,
50 PP_PictureData_Dev* picture_buffers); 51 PP_PictureBuffer_Dev* picture_buffers);
51 void ReusePictureBuffer(PP_PictureData_Dev* picture_buffer); 52 void ReusePictureBuffer(int32_t picture_buffer_id);
52 bool Flush(PP_CompletionCallback callback); 53 bool Flush(PP_CompletionCallback callback);
53 bool Abort(PP_CompletionCallback callback); 54 bool Abort(PP_CompletionCallback callback);
54 55
55 // media::VideoDecodeAccelerator::Client implementation. 56 // media::VideoDecodeAccelerator::Client implementation.
56 virtual void ProvidePictureBuffers( 57 virtual void ProvidePictureBuffers(
57 uint32_t requested_num_of_buffers, 58 uint32_t requested_num_of_buffers,
58 const std::vector<uint32_t>& buffer_properties) OVERRIDE; 59 const std::vector<uint32_t>& buffer_properties) OVERRIDE;
59 virtual void DismissPictureBuffer( 60 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE;
60 media::VideoDecodeAccelerator::PictureBuffer* picture_buffer) OVERRIDE;
61 virtual void PictureReady( 61 virtual void PictureReady(
62 media::VideoDecodeAccelerator::Picture* picture) OVERRIDE; 62 media::VideoDecodeAccelerator::Picture& picture) OVERRIDE;
scherkus (not reviewing) 2011/04/26 22:36:34 why ref versus pointer? if ref we usually go with
vrk (LEFT CHROMIUM) 2011/04/27 00:40:33 Const-ref'ed!
63 virtual void NotifyEndOfStream() OVERRIDE; 63 virtual void NotifyEndOfStream() OVERRIDE;
64 virtual void NotifyError( 64 virtual void NotifyError(
65 media::VideoDecodeAccelerator::Error error) OVERRIDE; 65 media::VideoDecodeAccelerator::Error error) OVERRIDE;
66 66
67 private: 67 private:
68 static media::VideoDecodeAccelerator::PictureBuffer*
69 CreateMediaPictureBuffer(struct PP_PictureBuffer_Dev& input);
scherkus (not reviewing) 2011/04/26 22:36:34 nit: c++ doesn't need struct also ref vs pointer
vrk (LEFT CHROMIUM) 2011/04/27 00:40:33 Done.
70
71 static media::VideoDecodeAccelerator::Picture*
72 CreateMediaPicture(struct PP_Picture_Dev& input);
scherkus (not reviewing) 2011/04/26 22:36:34 nit: c++ doesn't need struct also ref vs pointer
vrk (LEFT CHROMIUM) 2011/04/27 00:40:33 Done.
73
74 static struct PP_Picture_Dev* CreatePictureDev(
scherkus (not reviewing) 2011/04/26 22:36:34 nit: c++ doesn't need struct also ref vs pointer
vrk (LEFT CHROMIUM) 2011/04/27 00:40:33 Done.
75 media::VideoDecodeAccelerator::Picture& input);
76
68 void OnAbortComplete(); 77 void OnAbortComplete();
69 void OnBitstreamBufferProcessed(); 78 void OnBitstreamBufferProcessed();
70 void OnFlushComplete(); 79 void OnFlushComplete();
71 80
72 // This is NULL before initialization, and if this PPB_VideoDecoder_Impl is 81 // This is NULL before initialization, and if this PPB_VideoDecoder_Impl is
73 // swapped with another. 82 // swapped with another.
74 scoped_ptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_; 83 scoped_ptr<PluginDelegate::PlatformVideoDecoder> platform_video_decoder_;
75 84
76 // Factory to produce our callbacks. 85 // Factory to produce our callbacks.
77 base::ScopedCallbackFactory<PPB_VideoDecoder_Impl> callback_factory_; 86 base::ScopedCallbackFactory<PPB_VideoDecoder_Impl> callback_factory_;
78 87
79 PP_CompletionCallback abort_callback_; 88 PP_CompletionCallback abort_callback_;
80 PP_CompletionCallback flush_callback_; 89 PP_CompletionCallback flush_callback_;
81 PP_CompletionCallback bitstream_buffer_callback_; 90 PP_CompletionCallback bitstream_buffer_callback_;
82 91
83 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); 92 DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl);
84 }; 93 };
85 94
86 } // namespace ppapi 95 } // namespace ppapi
87 } // namespace webkit 96 } // namespace webkit
88 97
89 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_ 98 #endif // WEBKIT_PLUGINS_PPAPI_PPB_VIDEO_DECODER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698