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

Side by Side Diff: ppapi/cpp/video_frame.cc

Issue 107083004: [PPAPI] API definition for video media stream artifacts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix build warnings Created 6 years, 11 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
« no previous file with comments | « ppapi/cpp/video_frame.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ppapi/cpp/video_frame.h"
6
7 #include "ppapi/cpp/module.h"
8 #include "ppapi/cpp/module_impl.h"
9
10 namespace pp {
11
12 namespace {
13
14 template <> const char* interface_name<PPB_VideoFrame_0_1>() {
15 return PPB_VIDEOFRAME_INTERFACE_0_1;
16 }
17
18 }
19
20 VideoFrame::VideoFrame() {
21 }
22
23 VideoFrame::VideoFrame(const VideoFrame& other) : Resource(other) {
24 }
25
26 VideoFrame::VideoFrame(const Resource& resource) : Resource(resource) {
27 }
28
29 VideoFrame::VideoFrame(PassRef, PP_Resource resource)
30 : Resource(PASS_REF, resource) {
31 }
32
33 VideoFrame::~VideoFrame() {
34 }
35
36 PP_TimeDelta VideoFrame::GetTimestamp() const {
37 PP_TimeDelta timestamp = .0;
38 if (has_interface<PPB_VideoFrame_0_1>()) {
39 timestamp = get_interface<PPB_VideoFrame_0_1>()->GetTimestamp(
40 pp_resource());
41 }
42 return timestamp;
43 }
44
45 void VideoFrame::SetTimestamp(PP_TimeDelta timestamp) {
46 if (has_interface<PPB_VideoFrame_0_1>())
47 get_interface<PPB_VideoFrame_0_1>()->SetTimestamp(pp_resource(), timestamp);
48 }
49
50 PP_VideoFrame_Format VideoFrame::GetFormat() const {
51 if (has_interface<PPB_VideoFrame_0_1>())
52 return get_interface<PPB_VideoFrame_0_1>()->GetFormat(pp_resource());
53 return PP_VIDEOFRAME_FORMAT_UNKNOWN;
54 }
55
56 bool VideoFrame::GetSize(Size* size) const {
57 if (has_interface<PPB_VideoFrame_0_1>())
58 return PP_ToBool(get_interface<PPB_VideoFrame_0_1>()->GetSize(
59 pp_resource(), &size->pp_size()));
60 return false;
61 }
62
63 void* VideoFrame::GetDataBuffer() {
64 if (has_interface<PPB_VideoFrame_0_1>())
65 return get_interface<PPB_VideoFrame_0_1>()->GetDataBuffer(pp_resource());
66 return NULL;
67 }
68
69 uint32_t VideoFrame::GetDataBufferSize() const {
70 if (has_interface<PPB_VideoFrame_0_1>()) {
71 return get_interface<PPB_VideoFrame_0_1>()->GetDataBufferSize(
72 pp_resource());
73 }
74 return 0;
75 }
76
77 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/video_frame.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698