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

Side by Side Diff: media/cast/cast_sender_impl.h

Issue 163553006: Cast: Refactoring Cast API's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef MEDIA_CAST_CAST_SENDER_IMPL_H_ 4 #ifndef MEDIA_CAST_CAST_SENDER_IMPL_H_
5 #define MEDIA_CAST_CAST_SENDER_IMPL_H_ 5 #define MEDIA_CAST_CAST_SENDER_IMPL_H_
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "media/cast/audio_sender/audio_sender.h" 9 #include "media/cast/audio_sender/audio_sender.h"
10 #include "media/cast/cast_config.h" 10 #include "media/cast/cast_config.h"
11 #include "media/cast/cast_defines.h"
11 #include "media/cast/cast_environment.h" 12 #include "media/cast/cast_environment.h"
12 #include "media/cast/cast_sender.h" 13 #include "media/cast/cast_sender.h"
13 #include "media/cast/video_sender/video_sender.h" 14 #include "media/cast/video_sender/video_sender.h"
14 15
15 namespace media { 16 namespace media {
16 class VideoFrame; 17 class VideoFrame;
17 } 18 }
18 19
19 namespace media { 20 namespace media {
20 namespace cast { 21 namespace cast {
21 22
22 class AudioSender; 23 class AudioSender;
23 class VideoSender; 24 class VideoSender;
24 25
25 // This calls is a pure owner class that group all required sending objects 26 // This calls is a pure owner class that group all required sending objects
Ami GONE FROM CHROMIUM 2014/02/13 18:02:14 s/calls// ? (I bet you can English this comment up
mikhal1 2014/02/14 18:03:16 hmmm, Even I can't understand this one :) Let's se
26 // together such as pacer, packet receiver, frame input, audio and video sender. 27 // together such as pacer, packet receiver, frame input, audio and video sender.
27 class CastSenderImpl : public CastSender { 28 class CastSenderImpl : public CastSender {
28 public: 29 public:
29 CastSenderImpl( 30 CastSenderImpl(scoped_refptr<CastEnvironment> cast_environment,
30 scoped_refptr<CastEnvironment> cast_environment, 31 const CastInitializationCallback& cast_initialization,
31 const AudioSenderConfig* audio_config, 32 transport::CastTransportSender* const transport_sender);
32 const VideoSenderConfig* video_config, 33
33 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, 34 virtual void InitializeAudio(const AudioSenderConfig& audio_config) OVERRIDE;
34 const CastInitializationCallback& initialization_status, 35 virtual void InitializeVideo(
35 transport::CastTransportSender* const transport_sender); 36 const VideoSenderConfig& video_config,
37 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories)
38 OVERRIDE;
36 39
37 virtual ~CastSenderImpl(); 40 virtual ~CastSenderImpl();
38 41
39 virtual scoped_refptr<FrameInput> frame_input() OVERRIDE; 42 virtual scoped_refptr<FrameInput> frame_input() OVERRIDE;
40 virtual transport::PacketReceiverCallback packet_receiver() OVERRIDE; 43 virtual transport::PacketReceiverCallback packet_receiver() OVERRIDE;
41 44
42 private: 45 private:
43 void ReceivedPacket(scoped_ptr<Packet> packet); 46 void ReceivedPacket(scoped_ptr<Packet> packet);
44 // Used to trampoline the result back on the correct thread. And guaranteed 47 // Used to trampoline the result back on the correct thread. And guaranteed
45 // not to be called until the creation is complete. 48 // not to be called until the creation is complete.
46 void InitializationResult(CastInitializationStatus status) const; 49 void InitializationResult(CastInitializationStatus status) const;
47 50
48 CastInitializationCallback initialization_callback_; 51 CastInitializationCallback initialization_callback_;
49 scoped_ptr<AudioSender> audio_sender_; 52 scoped_ptr<AudioSender> audio_sender_;
50 scoped_ptr<VideoSender> video_sender_; 53 scoped_ptr<VideoSender> video_sender_;
51 scoped_refptr<FrameInput> frame_input_; 54 scoped_refptr<FrameInput> frame_input_;
52 transport::PacketReceiverCallback packet_receiver_; 55 transport::PacketReceiverCallback packet_receiver_;
53 scoped_refptr<CastEnvironment> cast_environment_; 56 scoped_refptr<CastEnvironment> cast_environment_;
57 transport::CastTransportSender* const transport_sender_;
Ami GONE FROM CHROMIUM 2014/02/13 18:02:14 // owned by ???
mikhal1 2014/02/14 18:03:16 Done.
54 uint32 ssrc_of_audio_sender_; 58 uint32 ssrc_of_audio_sender_;
55 uint32 ssrc_of_video_sender_; 59 uint32 ssrc_of_video_sender_;
56 base::WeakPtrFactory<CastSenderImpl> weak_factory_; 60 base::WeakPtrFactory<CastSenderImpl> weak_factory_;
57 61
58 DISALLOW_COPY_AND_ASSIGN(CastSenderImpl); 62 DISALLOW_COPY_AND_ASSIGN(CastSenderImpl);
59 }; 63 };
60 64
61 } // namespace cast 65 } // namespace cast
62 } // namespace media 66 } // namespace media
63 67
64 #endif // MEDIA_CAST_CAST_SENDER_IMPL_H_ 68 #endif // MEDIA_CAST_CAST_SENDER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698