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

Side by Side Diff: chrome/renderer/media/cast_session_delegate.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 4
5 #ifndef CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ 5 #ifndef CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_
6 #define CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ 6 #define CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // called the first media will be restarted. It is strongly recommended not to 49 // called the first media will be restarted. It is strongly recommended not to
50 // deliver any data between calling the two methods. 50 // deliver any data between calling the two methods.
51 // It's OK to call only one of the two methods. 51 // It's OK to call only one of the two methods.
52 void StartAudio(const media::cast::AudioSenderConfig& config, 52 void StartAudio(const media::cast::AudioSenderConfig& config,
53 const FrameInputAvailableCallback& callback); 53 const FrameInputAvailableCallback& callback);
54 void StartVideo(const media::cast::VideoSenderConfig& config, 54 void StartVideo(const media::cast::VideoSenderConfig& config,
55 const FrameInputAvailableCallback& callback); 55 const FrameInputAvailableCallback& callback);
56 56
57 protected: 57 protected:
58 // Callback with the result of the initialization. 58 // Callback with the result of the initialization.
59 // If this callback is called with STATUS_INITIALIZED it will report back 59 // If this callback is called with STATUS_INITIALIZED it will report back
Ami GONE FROM CHROMIUM 2014/02/13 18:02:14 update doco
mikhal1 2014/02/14 18:03:16 Done.
60 // to the sinks that it's ready to accept incoming audio / video frames. 60 // to the sinks that it's ready to accept incoming audio / video frames.
61 void InitializationResult(media::cast::CastInitializationStatus result) const; 61 void InitializationResult(media::cast::CastInitializationStatus result) const;
62 62
63 private: 63 private:
64 // Start encoding threads and initialize the CastEnvironment.
65 void Initialize();
66
67 // Configure CastSender. It is ready to accept audio / video frames after
68 // receiving a successful call to InitializationResult.
69 void StartSendingInternal(const FrameInputAvailableCallback& callback,
70 bool is_audio);
71
72 base::ThreadChecker thread_checker_; 64 base::ThreadChecker thread_checker_;
73 scoped_refptr<media::cast::CastEnvironment> cast_environment_; 65 scoped_refptr<media::cast::CastEnvironment> cast_environment_;
74 scoped_ptr<media::cast::CastSender> cast_sender_; 66 scoped_ptr<media::cast::CastSender> cast_sender_;
75 scoped_ptr<media::cast::transport::CastTransportSender> cast_transport_; 67 scoped_ptr<media::cast::transport::CastTransportSender> cast_transport_;
76 68
77 // Utilities threads owned by this class. They are used by CastSender for 69 // Utilities threads owned by this class. They are used by CastSender for
78 // encoding. 70 // encoding.
79 // TODO(hclam): See crbug.com/317006 for more details. 71 // TODO(hclam): See crbug.com/317006 for more details.
80 // This class shouldn't create and own threads. 72 // This class shouldn't create and own threads.
81 base::Thread audio_encode_thread_; 73 base::Thread audio_encode_thread_;
82 base::Thread video_encode_thread_; 74 base::Thread video_encode_thread_;
83 75
84 // Configuration for audio and video.
85 scoped_ptr<media::cast::AudioSenderConfig> audio_config_;
86 scoped_ptr<media::cast::VideoSenderConfig> video_config_;
87
88 scoped_ptr<FrameInputAvailableCallback> audio_frame_input_available_callback_; 76 scoped_ptr<FrameInputAvailableCallback> audio_frame_input_available_callback_;
89 scoped_ptr<FrameInputAvailableCallback> video_frame_input_available_callback_; 77 scoped_ptr<FrameInputAvailableCallback> video_frame_input_available_callback_;
90 78
91 // Proxy to the IO message loop. 79 // Proxy to the IO message loop.
92 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; 80 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
93 81
94 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate); 82 DISALLOW_COPY_AND_ASSIGN(CastSessionDelegate);
95 }; 83 };
96 84
97 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_ 85 #endif // CHROME_RENDERER_MEDIA_CAST_SESSION_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/media/cast_session_delegate.cc » ('j') | chrome/renderer/media/cast_session_delegate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698