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

Side by Side Diff: chromecast/browser/media/media_pipeline_host.cc

Issue 1168643004: Allow CastContentBrowserClient to customise media pipeline device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment updates + Android exclusion Created 5 years, 6 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
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 #include "chromecast/browser/media/media_pipeline_host.h" 5 #include "chromecast/browser/media/media_pipeline_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 for (MediaTrackMap::iterator it = media_track_map_.begin(); 46 for (MediaTrackMap::iterator it = media_track_map_.begin();
47 it != media_track_map_.end(); ++it) { 47 it != media_track_map_.end(); ++it) {
48 scoped_ptr<MediaTrackHost> media_track(it->second); 48 scoped_ptr<MediaTrackHost> media_track(it->second);
49 } 49 }
50 media_track_map_.clear(); 50 media_track_map_.clear();
51 } 51 }
52 52
53 void MediaPipelineHost::Initialize( 53 void MediaPipelineHost::Initialize(
54 LoadType load_type, 54 LoadType load_type,
55 const MediaPipelineClient& client) { 55 const MediaPipelineClient& client,
56 const media::CreatePipelineDeviceCB& create_pipeline_device_cb) {
56 DCHECK(thread_checker_.CalledOnValidThread()); 57 DCHECK(thread_checker_.CalledOnValidThread());
57 media_pipeline_.reset(new MediaPipelineImpl()); 58 media_pipeline_.reset(new MediaPipelineImpl());
58 MediaPipelineDeviceParams default_parameters; 59 MediaPipelineDeviceParams default_parameters;
59 if (load_type == kLoadTypeMediaStream) 60 if (load_type == kLoadTypeMediaStream)
60 default_parameters.sync_type = MediaPipelineDeviceParams::kModeIgnorePts; 61 default_parameters.sync_type = MediaPipelineDeviceParams::kModeIgnorePts;
61 media_pipeline_->Initialize( 62 media_pipeline_->Initialize(
62 load_type, 63 load_type, create_pipeline_device_cb.Run(default_parameters).Pass());
63 CreateMediaPipelineDevice(default_parameters).Pass());
64 media_pipeline_->SetClient(client); 64 media_pipeline_->SetClient(client);
65 } 65 }
66 66
67 void MediaPipelineHost::SetAvPipe( 67 void MediaPipelineHost::SetAvPipe(
68 TrackId track_id, 68 TrackId track_id,
69 scoped_ptr<base::SharedMemory> shared_mem, 69 scoped_ptr<base::SharedMemory> shared_mem,
70 const base::Closure& pipe_read_activity_cb, 70 const base::Closure& pipe_read_activity_cb,
71 const base::Closure& av_pipe_set_cb) { 71 const base::Closure& av_pipe_set_cb) {
72 DCHECK(thread_checker_.CalledOnValidThread()); 72 DCHECK(thread_checker_.CalledOnValidThread());
73 CHECK(track_id == kAudioTrackId || track_id == kVideoTrackId); 73 CHECK(track_id == kAudioTrackId || track_id == kVideoTrackId);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (it == media_track_map_.end()) 164 if (it == media_track_map_.end())
165 return; 165 return;
166 166
167 MediaTrackHost* media_track_host = it->second; 167 MediaTrackHost* media_track_host = it->second;
168 if (!media_track_host->pipe_write_cb.is_null()) 168 if (!media_track_host->pipe_write_cb.is_null())
169 media_track_host->pipe_write_cb.Run(); 169 media_track_host->pipe_write_cb.Run();
170 } 170 }
171 171
172 } // namespace media 172 } // namespace media
173 } // namespace chromecast 173 } // namespace chromecast
174
OLDNEW
« no previous file with comments | « chromecast/browser/media/media_pipeline_host.h ('k') | chromecast/media/cma/backend/media_pipeline_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698