OLD | NEW |
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 #include "ppapi/proxy/media_stream_audio_track_resource.h" | 5 #include "ppapi/proxy/media_stream_audio_track_resource.h" |
6 | 6 |
7 #include "ppapi/proxy/audio_buffer_resource.h" | 7 #include "ppapi/proxy/audio_buffer_resource.h" |
8 #include "ppapi/proxy/ppapi_messages.h" | 8 #include "ppapi/proxy/ppapi_messages.h" |
9 #include "ppapi/shared_impl/media_stream_audio_track_shared.h" | 9 #include "ppapi/shared_impl/media_stream_audio_track_shared.h" |
10 #include "ppapi/shared_impl/media_stream_buffer.h" | 10 #include "ppapi/shared_impl/media_stream_buffer.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 if (!buffers_.empty()) | 55 if (!buffers_.empty()) |
56 return PP_ERROR_INPROGRESS; | 56 return PP_ERROR_INPROGRESS; |
57 | 57 |
58 MediaStreamAudioTrackShared::Attributes attributes; | 58 MediaStreamAudioTrackShared::Attributes attributes; |
59 int i = 0; | 59 int i = 0; |
60 for (; attrib_list[i] != PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE; i += 2) { | 60 for (; attrib_list[i] != PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE; i += 2) { |
61 switch (attrib_list[i]) { | 61 switch (attrib_list[i]) { |
62 case PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS: | 62 case PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS: |
63 attributes.buffers = attrib_list[i + 1]; | 63 attributes.buffers = attrib_list[i + 1]; |
64 break; | 64 break; |
| 65 case PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION: |
| 66 attributes.duration = attrib_list[i + 1]; |
| 67 break; |
65 case PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_RATE: | 68 case PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_RATE: |
66 case PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_SIZE: | 69 case PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_SIZE: |
67 case PP_MEDIASTREAMAUDIOTRACK_ATTRIB_CHANNELS: | 70 case PP_MEDIASTREAMAUDIOTRACK_ATTRIB_CHANNELS: |
68 case PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION: | |
69 return PP_ERROR_NOTSUPPORTED; | 71 return PP_ERROR_NOTSUPPORTED; |
70 default: | 72 default: |
71 return PP_ERROR_BADARGUMENT; | 73 return PP_ERROR_BADARGUMENT; |
72 } | 74 } |
73 } | 75 } |
74 | 76 |
75 if (!MediaStreamAudioTrackShared::VerifyAttributes(attributes)) | 77 if (!MediaStreamAudioTrackShared::VerifyAttributes(attributes)) |
76 return PP_ERROR_BADARGUMENT; | 78 return PP_ERROR_BADARGUMENT; |
77 | 79 |
78 configure_callback_ = callback; | 80 configure_callback_ = callback; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 const ResourceMessageReplyParams& params) { | 190 const ResourceMessageReplyParams& params) { |
189 if (TrackedCallback::IsPending(configure_callback_)) { | 191 if (TrackedCallback::IsPending(configure_callback_)) { |
190 scoped_refptr<TrackedCallback> callback; | 192 scoped_refptr<TrackedCallback> callback; |
191 callback.swap(configure_callback_); | 193 callback.swap(configure_callback_); |
192 callback->Run(params.result()); | 194 callback->Run(params.result()); |
193 } | 195 } |
194 } | 196 } |
195 | 197 |
196 } // namespace proxy | 198 } // namespace proxy |
197 } // namespace ppapi | 199 } // namespace ppapi |
OLD | NEW |