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

Side by Side Diff: content/renderer/media/webrtc/peer_connection_dependency_factory.h

Issue 2418613002: Proxy RtcVideoDecoder calls to a media::VideoDecoder.
Patch Set: Comments addressed and unittests updated. Created 4 years, 1 month 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 CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file.h" 10 #include "base/files/file.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
15 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
16 #include "content/renderer/media/webrtc/stun_field_trial.h" 16 #include "content/renderer/media/webrtc/stun_field_trial.h"
17 #include "content/renderer/p2p/socket_dispatcher.h" 17 #include "content/renderer/p2p/socket_dispatcher.h"
18 #include "ipc/ipc_platform_file.h" 18 #include "ipc/ipc_platform_file.h"
19 #include "third_party/webrtc/api/peerconnectioninterface.h" 19 #include "third_party/webrtc/api/peerconnectioninterface.h"
20 #include "third_party/webrtc/p2p/stunprober/stunprober.h" 20 #include "third_party/webrtc/p2p/stunprober/stunprober.h"
21 21
22 namespace base { 22 namespace base {
23 class WaitableEvent; 23 class WaitableEvent;
24 } 24 }
25 25
26 namespace media { 26 namespace media {
27 class GpuVideoAcceleratorFactories; 27 class GpuVideoAcceleratorFactories;
28 class VideoDecoder;
28 } 29 }
29 30
30 namespace rtc { 31 namespace rtc {
31 class NetworkManager; 32 class NetworkManager;
32 class PacketSocketFactory; 33 class PacketSocketFactory;
33 class Thread; 34 class Thread;
34 } 35 }
35 36
36 namespace blink { 37 namespace blink {
37 class WebFrame; 38 class WebFrame;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 126
126 // Functions related to Stun probing trial to determine how fast we could send 127 // Functions related to Stun probing trial to determine how fast we could send
127 // Stun request without being dropped by NAT. 128 // Stun request without being dropped by NAT.
128 void TryScheduleStunProbeTrial(); 129 void TryScheduleStunProbeTrial();
129 void StartStunProbeTrialOnWorkerThread(const std::string& params); 130 void StartStunProbeTrialOnWorkerThread(const std::string& params);
130 131
131 // Creates |pc_factory_|, which in turn is used for 132 // Creates |pc_factory_|, which in turn is used for
132 // creating PeerConnection objects. 133 // creating PeerConnection objects.
133 void CreatePeerConnectionFactory(); 134 void CreatePeerConnectionFactory();
134 135
136 // A factory closure which can be run to create a media::VideoDecoder.
137 using CreateVideoDecoderCB =
138 base::Callback<std::unique_ptr<media::VideoDecoder>()>;
139
135 void InitializeSignalingThread( 140 void InitializeSignalingThread(
136 media::GpuVideoAcceleratorFactories* gpu_factories, 141 media::GpuVideoAcceleratorFactories* gpu_factories,
142 const CreateVideoDecoderCB& create_video_decoder_cb,
143 const scoped_refptr<base::SingleThreadTaskRunner>& decoder_task_runner,
137 base::WaitableEvent* event); 144 base::WaitableEvent* event);
138 145
139 void InitializeWorkerThread(rtc::Thread** thread, 146 void InitializeWorkerThread(rtc::Thread** thread,
140 base::WaitableEvent* event); 147 base::WaitableEvent* event);
141 148
142 void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event); 149 void CreateIpcNetworkManagerOnWorkerThread(base::WaitableEvent* event);
143 void DeleteIpcNetworkManager(); 150 void DeleteIpcNetworkManager();
144 void CleanupPeerConnectionFactory(); 151 void CleanupPeerConnectionFactory();
145 152
146 // We own network_manager_, must be deleted on the worker thread. 153 // We own network_manager_, must be deleted on the worker thread.
(...skipping 14 matching lines...) Expand all
161 rtc::Thread* worker_thread_; 168 rtc::Thread* worker_thread_;
162 base::Thread chrome_signaling_thread_; 169 base::Thread chrome_signaling_thread_;
163 base::Thread chrome_worker_thread_; 170 base::Thread chrome_worker_thread_;
164 171
165 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory); 172 DISALLOW_COPY_AND_ASSIGN(PeerConnectionDependencyFactory);
166 }; 173 };
167 174
168 } // namespace content 175 } // namespace content
169 176
170 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ 177 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PEER_CONNECTION_DEPENDENCY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698