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
3 // found in the LICENSE file.
5 #ifndef MEDIA_CAST_CAST_RECEIVER_H_
6 #define MEDIA_CAST_CAST_RECEIVER_H_
8 #include "base/basictypes.h"
9 #include "base/time/time.h"
10 #include "media/cast/cast_config.h"
17 virtual bool GetRawVideoFrame(I420VideoFrame
* video_frame
,
18 base::TimeTicks
* render_time
) = 0;
20 virtual bool GetEncodedVideoFrame(EncodedVideoFrame
* video_frame
,
21 base::TimeTicks
* render_time
) = 0;
23 virtual void ReleaseEncodedVideoFrame(uint8 frame_id
) = 0;
25 virtual bool GetRawAudioFrame(int number_of_10ms_blocks
,
26 int desired_frequency
,
27 PcmAudioFrame
* audio_frame
,
28 base::TimeTicks
* playout_time
) = 0;
30 virtual bool GetCodedAudioFrame(EncodedAudioFrame
* audio_frame
,
31 base::TimeTicks
* playout_time
) = 0;
33 virtual void ReleaseCodedAudioFrame(uint8 frame_id
) = 0;
36 virtual ~FrameReceiver() {}
41 static CastReceiver
* CreateCastReceiver(
42 const AudioReceiverConfig
& audio_config
,
43 const VideoReceiverConfig
& video_config
,
44 PacketSender
* const packet_sender
);
46 // All received RTP and RTCP packets for the call should be inserted to this
47 // PacketReceiver. The PacketReceiver pointer is valid as long as the
48 // CastReceiver instance exists.
49 virtual PacketReceiver
* packet_receiver() = 0;
51 // Polling interface to get audio and video frames from the CastReceiver.
52 virtual FrameReceiver
* frame_receiver() = 0;
54 virtual ~CastReceiver() {};
60 #endif // MEDIA_CAST_CAST_RECEIVER_H_