OLD | NEW |
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 MEDIA_CAST_FRAMER_FRAMER_H_ | 5 #ifndef MEDIA_CAST_FRAMER_FRAMER_H_ |
6 #define MEDIA_CAST_FRAMER_FRAMER_H_ | 6 #define MEDIA_CAST_FRAMER_FRAMER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Return true when receiving the last packet in a frame, creating a | 35 // Return true when receiving the last packet in a frame, creating a |
36 // complete frame. | 36 // complete frame. |
37 bool InsertPacket(const uint8* payload_data, | 37 bool InsertPacket(const uint8* payload_data, |
38 size_t payload_size, | 38 size_t payload_size, |
39 const RtpCastHeader& rtp_header); | 39 const RtpCastHeader& rtp_header); |
40 | 40 |
41 // Extracts a complete encoded frame - will only return a complete continuous | 41 // Extracts a complete encoded frame - will only return a complete continuous |
42 // frame. | 42 // frame. |
43 // Returns false if the frame does not exist or if the frame is not complete | 43 // Returns false if the frame does not exist or if the frame is not complete |
44 // within the given time frame. | 44 // within the given time frame. |
45 bool GetEncodedVideoFrame(EncodedVideoFrame* video_frame, | 45 bool GetEncodedVideoFrame(transport::EncodedVideoFrame* video_frame, |
46 uint32* rtp_timestamp, | 46 uint32* rtp_timestamp, |
47 bool* next_frame); | 47 bool* next_frame); |
48 | 48 |
49 bool GetEncodedAudioFrame(EncodedAudioFrame* audio_frame, | 49 bool GetEncodedAudioFrame(transport::EncodedAudioFrame* audio_frame, |
50 uint32* rtp_timestamp, | 50 uint32* rtp_timestamp, |
51 bool* next_frame); | 51 bool* next_frame); |
52 | 52 |
53 void ReleaseFrame(uint32 frame_id); | 53 void ReleaseFrame(uint32 frame_id); |
54 | 54 |
55 // Reset framer state to original state and flush all pending buffers. | 55 // Reset framer state to original state and flush all pending buffers. |
56 void Reset(); | 56 void Reset(); |
57 bool TimeToSendNextCastMessage(base::TimeTicks* time_to_send); | 57 bool TimeToSendNextCastMessage(base::TimeTicks* time_to_send); |
58 void SendCastMessage(); | 58 void SendCastMessage(); |
59 | 59 |
60 private: | 60 private: |
61 const bool decoder_faster_than_max_frame_rate_; | 61 const bool decoder_faster_than_max_frame_rate_; |
62 FrameList frames_; | 62 FrameList frames_; |
63 FrameIdMap frame_id_map_; | 63 FrameIdMap frame_id_map_; |
64 | 64 |
65 scoped_ptr<CastMessageBuilder> cast_msg_builder_; | 65 scoped_ptr<CastMessageBuilder> cast_msg_builder_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(Framer); | 67 DISALLOW_COPY_AND_ASSIGN(Framer); |
68 }; | 68 }; |
69 | 69 |
70 } // namespace cast | 70 } // namespace cast |
71 } // namespace media | 71 } // namespace media |
72 | 72 |
73 #endif // MEDIA_CAST_FRAMER_FRAMER_H_ | 73 #endif // MEDIA_CAST_FRAMER_FRAMER_H_ |
OLD | NEW |