OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_DELEGATE_H_ |
| 6 #define CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_DELEGATE_H_ |
| 7 |
| 8 #include "chrome/renderer/media/cast_receiver_audio_valve.h" |
| 9 #include "chrome/renderer/media/cast_session_delegate.h" |
| 10 #include "content/public/renderer/media_stream_video_sink.h" |
| 11 #include "media/base/video_capture_types.h" |
| 12 #include "media/cast/cast_receiver.h" |
| 13 |
| 14 class CastReceiverSessionDelegate : public CastSessionDelegateBase { |
| 15 public: |
| 16 CastReceiverSessionDelegate(); |
| 17 ~CastReceiverSessionDelegate() override; |
| 18 |
| 19 void ReceivePacket(scoped_ptr<media::cast::Packet> packet) override; |
| 20 void LogRawEvents( |
| 21 const std::vector<media::cast::PacketEvent>& packet_events, |
| 22 const std::vector<media::cast::FrameEvent>& frame_events) override; |
| 23 |
| 24 void Start(const media::cast::FrameReceiverConfig& audio_config, |
| 25 const media::cast::FrameReceiverConfig& video_config, |
| 26 const net::IPEndPoint& local_endpoint, |
| 27 const net::IPEndPoint& remote_endpoint, |
| 28 scoped_ptr<base::DictionaryValue> options, |
| 29 const media::VideoCaptureFormat& format); |
| 30 |
| 31 void StartAudio(scoped_refptr<CastReceiverAudioValve> audio_valve); |
| 32 |
| 33 void StartVideo(content::VideoCaptureDeliverFrameCB frame_callback); |
| 34 // Stop Video callbacks (eventually). |
| 35 void StopVideo(); |
| 36 |
| 37 private: |
| 38 void OnDecodedAudioFrame(scoped_ptr<media::AudioBus> audio_bus, |
| 39 const base::TimeTicks& playout_time, |
| 40 bool is_continous); |
| 41 |
| 42 void OnDecodedVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, |
| 43 const base::TimeTicks& playout_time, |
| 44 bool is_continous); |
| 45 |
| 46 scoped_refptr<CastReceiverAudioValve> audio_valve_; |
| 47 content::VideoCaptureDeliverFrameCB frame_callback_; |
| 48 media::cast::AudioFrameDecodedCallback on_audio_decoded_cb_; |
| 49 media::cast::VideoFrameDecodedCallback on_video_decoded_cb_; |
| 50 scoped_ptr<media::cast::CastReceiver> cast_receiver_; |
| 51 media::VideoCaptureFormat format_; |
| 52 base::WeakPtrFactory<CastReceiverSessionDelegate> weak_factory_; |
| 53 DISALLOW_COPY_AND_ASSIGN(CastReceiverSessionDelegate); |
| 54 }; |
| 55 |
| 56 #endif // CHROME_RENDERER_MEDIA_CAST_RECEIVER_SESSION_DELEGATE_H_ |
OLD | NEW |