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

Side by Side Diff: ppapi/thunk/ppb_media_stream_audio_track_thunk.cc

Issue 156863005: [PPAPI][MediaStream] Rename AudioFrame to AudioBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@frame_to_buffer
Patch Set: Update Created 6 years, 10 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/thunk/ppb_media_stream_audio_track_api.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // From ppb_media_stream_audio_track.idl modified Thu Jan 23 15:04:50 2014. 5 // From ppb_media_stream_audio_track.idl modified Thu Feb 6 15:43:37 2014.
6 6
7 #include "ppapi/c/pp_completion_callback.h" 7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/ppb_media_stream_audio_track.h" 9 #include "ppapi/c/ppb_media_stream_audio_track.h"
10 #include "ppapi/shared_impl/tracked_callback.h" 10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h" 12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_media_stream_audio_track_api.h" 13 #include "ppapi/thunk/ppb_media_stream_audio_track_api.h"
14 14
15 namespace ppapi { 15 namespace ppapi {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 PP_Bool HasEnded(PP_Resource audio_track) { 57 PP_Bool HasEnded(PP_Resource audio_track) {
58 VLOG(4) << "PPB_MediaStreamAudioTrack::HasEnded()"; 58 VLOG(4) << "PPB_MediaStreamAudioTrack::HasEnded()";
59 EnterResource<PPB_MediaStreamAudioTrack_API> enter(audio_track, true); 59 EnterResource<PPB_MediaStreamAudioTrack_API> enter(audio_track, true);
60 if (enter.failed()) 60 if (enter.failed())
61 return PP_TRUE; 61 return PP_TRUE;
62 return enter.object()->HasEnded(); 62 return enter.object()->HasEnded();
63 } 63 }
64 64
65 int32_t GetFrame(PP_Resource audio_track, 65 int32_t GetBuffer(PP_Resource audio_track,
66 PP_Resource* frame, 66 PP_Resource* buffer,
67 struct PP_CompletionCallback callback) { 67 struct PP_CompletionCallback callback) {
68 VLOG(4) << "PPB_MediaStreamAudioTrack::GetFrame()"; 68 VLOG(4) << "PPB_MediaStreamAudioTrack::GetBuffer()";
69 EnterResource<PPB_MediaStreamAudioTrack_API> enter(audio_track, 69 EnterResource<PPB_MediaStreamAudioTrack_API> enter(audio_track,
70 callback, 70 callback,
71 true); 71 true);
72 if (enter.failed()) 72 if (enter.failed())
73 return enter.retval(); 73 return enter.retval();
74 return enter.SetResult(enter.object()->GetFrame(frame, enter.callback())); 74 return enter.SetResult(enter.object()->GetBuffer(buffer, enter.callback()));
75 } 75 }
76 76
77 int32_t RecycleFrame(PP_Resource audio_track, PP_Resource frame) { 77 int32_t RecycleBuffer(PP_Resource audio_track, PP_Resource buffer) {
78 VLOG(4) << "PPB_MediaStreamAudioTrack::RecycleFrame()"; 78 VLOG(4) << "PPB_MediaStreamAudioTrack::RecycleBuffer()";
79 EnterResource<PPB_MediaStreamAudioTrack_API> enter(audio_track, true); 79 EnterResource<PPB_MediaStreamAudioTrack_API> enter(audio_track, true);
80 if (enter.failed()) 80 if (enter.failed())
81 return enter.retval(); 81 return enter.retval();
82 return enter.object()->RecycleFrame(frame); 82 return enter.object()->RecycleBuffer(buffer);
83 } 83 }
84 84
85 void Close(PP_Resource audio_track) { 85 void Close(PP_Resource audio_track) {
86 VLOG(4) << "PPB_MediaStreamAudioTrack::Close()"; 86 VLOG(4) << "PPB_MediaStreamAudioTrack::Close()";
87 EnterResource<PPB_MediaStreamAudioTrack_API> enter(audio_track, true); 87 EnterResource<PPB_MediaStreamAudioTrack_API> enter(audio_track, true);
88 if (enter.failed()) 88 if (enter.failed())
89 return; 89 return;
90 enter.object()->Close(); 90 enter.object()->Close();
91 } 91 }
92 92
93 const PPB_MediaStreamAudioTrack_0_1 g_ppb_mediastreamaudiotrack_thunk_0_1 = { 93 const PPB_MediaStreamAudioTrack_0_1 g_ppb_mediastreamaudiotrack_thunk_0_1 = {
94 &IsMediaStreamAudioTrack, 94 &IsMediaStreamAudioTrack,
95 &Configure, 95 &Configure,
96 &GetAttrib, 96 &GetAttrib,
97 &GetId, 97 &GetId,
98 &HasEnded, 98 &HasEnded,
99 &GetFrame, 99 &GetBuffer,
100 &RecycleFrame, 100 &RecycleBuffer,
101 &Close 101 &Close
102 }; 102 };
103 103
104 } // namespace 104 } // namespace
105 105
106 PPAPI_THUNK_EXPORT const PPB_MediaStreamAudioTrack_0_1* 106 PPAPI_THUNK_EXPORT const PPB_MediaStreamAudioTrack_0_1*
107 GetPPB_MediaStreamAudioTrack_0_1_Thunk() { 107 GetPPB_MediaStreamAudioTrack_0_1_Thunk() {
108 return &g_ppb_mediastreamaudiotrack_thunk_0_1; 108 return &g_ppb_mediastreamaudiotrack_thunk_0_1;
109 } 109 }
110 110
111 } // namespace thunk 111 } // namespace thunk
112 } // namespace ppapi 112 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_media_stream_audio_track_api.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698