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

Side by Side Diff: chromecast/browser/media/cma_message_filter_host.h

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 #ifndef CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_FILTER_HOST_H_ 5 #ifndef CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_FILTER_HOST_H_
6 #define CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_FILTER_HOST_H_ 6 #define CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_FILTER_HOST_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/shared_memory.h" 12 #include "base/memory/shared_memory.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "chromecast/common/media/cma_ipc_common.h" 14 #include "chromecast/common/media/cma_ipc_common.h"
15 #include "chromecast/media/cma/backend/media_pipeline_device.h"
15 #include "chromecast/media/cma/pipeline/load_type.h" 16 #include "chromecast/media/cma/pipeline/load_type.h"
16 #include "content/public/browser/browser_message_filter.h" 17 #include "content/public/browser/browser_message_filter.h"
17 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
18 #include "media/base/buffering_state.h" 19 #include "media/base/buffering_state.h"
19 #include "media/base/pipeline_status.h" 20 #include "media/base/pipeline_status.h"
20 21
21 namespace base { 22 namespace base {
22 class CancelableSyncSocket; 23 class CancelableSyncSocket;
23 class SingleThreadTaskRunner; 24 class SingleThreadTaskRunner;
24 } 25 }
(...skipping 10 matching lines...) Expand all
35 } 36 }
36 37
37 namespace chromecast { 38 namespace chromecast {
38 namespace media { 39 namespace media {
39 40
40 class MediaPipelineHost; 41 class MediaPipelineHost;
41 42
42 class CmaMessageFilterHost 43 class CmaMessageFilterHost
43 : public content::BrowserMessageFilter { 44 : public content::BrowserMessageFilter {
44 public: 45 public:
45 explicit CmaMessageFilterHost(int render_process_id); 46 CmaMessageFilterHost(
47 int render_process_id,
48 const media::CreatePipelineDeviceCB& create_pipeline_device_cb);
46 49
47 // content::BrowserMessageFilter implementation. 50 // content::BrowserMessageFilter implementation.
48 void OnChannelClosing() override; 51 void OnChannelClosing() override;
49 void OnDestruct() const override; 52 void OnDestruct() const override;
50 bool OnMessageReceived(const IPC::Message& message) override; 53 bool OnMessageReceived(const IPC::Message& message) override;
51 54
52 private: 55 private:
53 typedef std::map<int, MediaPipelineHost*> MediaPipelineMap; 56 typedef std::map<int, MediaPipelineHost*> MediaPipelineMap;
54 57
55 friend class content::BrowserThread; 58 friend class content::BrowserThread;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 void OnStatisticsUpdated(int media_id, 105 void OnStatisticsUpdated(int media_id,
103 TrackId track_id, 106 TrackId track_id,
104 const ::media::PipelineStatistics& stats); 107 const ::media::PipelineStatistics& stats);
105 void OnNaturalSizeChanged(int media_id, 108 void OnNaturalSizeChanged(int media_id,
106 TrackId track_id, 109 TrackId track_id,
107 const gfx::Size& size); 110 const gfx::Size& size);
108 111
109 // Render process ID correponding to this message filter. 112 // Render process ID correponding to this message filter.
110 const int process_id_; 113 const int process_id_;
111 114
115 // Factory function for device-specific part of media pipeline creation
116 media::CreatePipelineDeviceCB create_pipeline_device_cb_;
117
112 // List of media pipeline and message loop media pipelines are running on. 118 // List of media pipeline and message loop media pipelines are running on.
113 MediaPipelineMap media_pipelines_; 119 MediaPipelineMap media_pipelines_;
114 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 120 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
115 121
116 base::WeakPtr<CmaMessageFilterHost> weak_this_; 122 base::WeakPtr<CmaMessageFilterHost> weak_this_;
117 base::WeakPtrFactory<CmaMessageFilterHost> weak_factory_; 123 base::WeakPtrFactory<CmaMessageFilterHost> weak_factory_;
118 124
119 DISALLOW_COPY_AND_ASSIGN(CmaMessageFilterHost); 125 DISALLOW_COPY_AND_ASSIGN(CmaMessageFilterHost);
120 }; 126 };
121 127
122 } // namespace media 128 } // namespace media
123 } // namespace chromecast 129 } // namespace chromecast
124 130
125 #endif // CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_FILTER_HOST_H_ 131 #endif // CHROMECAST_BROWSER_MEDIA_CMA_MESSAGE_FILTER_HOST_H_
126
OLDNEW
« no previous file with comments | « chromecast/browser/cast_content_browser_client_simple.cc ('k') | chromecast/browser/media/cma_message_filter_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698