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

Side by Side Diff: ppapi/cpp/dev/video_decoder_dev.cc

Issue 7361010: Enable fire-and-forget Destroy of HW video decoder, and misc other improvements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: vrk CR responses. Created 9 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 | 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 #include "ppapi/cpp/dev/video_decoder_dev.h" 5 #include "ppapi/cpp/dev/video_decoder_dev.h"
6 6
7 #include "ppapi/c/dev/ppb_video_decoder_dev.h" 7 #include "ppapi/c/dev/ppb_video_decoder_dev.h"
8 #include "ppapi/c/dev/ppp_video_decoder_dev.h" 8 #include "ppapi/c/dev/ppp_video_decoder_dev.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/cpp/dev/context_3d_dev.h" 10 #include "ppapi/cpp/dev/context_3d_dev.h"
(...skipping 14 matching lines...) Expand all
25 VideoDecoder_Dev::VideoDecoder_Dev(const Instance& instance) { 25 VideoDecoder_Dev::VideoDecoder_Dev(const Instance& instance) {
26 if (!has_interface<PPB_VideoDecoder_Dev>()) 26 if (!has_interface<PPB_VideoDecoder_Dev>())
27 return; 27 return;
28 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create( 28 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create(
29 instance.pp_instance())); 29 instance.pp_instance()));
30 } 30 }
31 31
32 VideoDecoder_Dev::VideoDecoder_Dev(PP_Resource resource) : Resource(resource) { 32 VideoDecoder_Dev::VideoDecoder_Dev(PP_Resource resource) : Resource(resource) {
33 } 33 }
34 34
35 VideoDecoder_Dev::~VideoDecoder_Dev() {} 35 VideoDecoder_Dev::~VideoDecoder_Dev() {
36 get_interface<PPB_VideoDecoder_Dev>()->Destroy(pp_resource());
37 }
38
36 39
37 int32_t VideoDecoder_Dev::Initialize(const PP_VideoConfigElement* config, 40 int32_t VideoDecoder_Dev::Initialize(const PP_VideoConfigElement* config,
38 const Context3D_Dev& context, 41 const Context3D_Dev& context,
39 CompletionCallback callback) { 42 CompletionCallback callback) {
40 if (!has_interface<PPB_VideoDecoder_Dev>()) 43 if (!has_interface<PPB_VideoDecoder_Dev>())
41 return callback.MayForce(PP_ERROR_NOINTERFACE); 44 return callback.MayForce(PP_ERROR_NOINTERFACE);
42 return get_interface<PPB_VideoDecoder_Dev>()->Initialize( 45 return get_interface<PPB_VideoDecoder_Dev>()->Initialize(
43 pp_resource(), context.pp_resource(), config, 46 pp_resource(), context.pp_resource(), config,
44 callback.pp_completion_callback()); 47 callback.pp_completion_callback());
45 } 48 }
(...skipping 29 matching lines...) Expand all
75 pp_resource(), callback.pp_completion_callback()); 78 pp_resource(), callback.pp_completion_callback());
76 } 79 }
77 80
78 int32_t VideoDecoder_Dev::Reset(CompletionCallback callback) { 81 int32_t VideoDecoder_Dev::Reset(CompletionCallback callback) {
79 if (!has_interface<PPB_VideoDecoder_Dev>()) 82 if (!has_interface<PPB_VideoDecoder_Dev>())
80 return callback.MayForce(PP_ERROR_NOINTERFACE); 83 return callback.MayForce(PP_ERROR_NOINTERFACE);
81 return get_interface<PPB_VideoDecoder_Dev>()->Reset( 84 return get_interface<PPB_VideoDecoder_Dev>()->Reset(
82 pp_resource(), callback.pp_completion_callback()); 85 pp_resource(), callback.pp_completion_callback());
83 } 86 }
84 87
85 int32_t VideoDecoder_Dev::Destroy(CompletionCallback callback) {
86 if (!has_interface<PPB_VideoDecoder_Dev>())
87 return callback.MayForce(PP_ERROR_NOINTERFACE);
88 return get_interface<PPB_VideoDecoder_Dev>()->Destroy(
89 pp_resource(), callback.pp_completion_callback());
90 }
91
92 } // namespace pp 88 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698