Chromium Code Reviews| 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 22 matching lines...) Expand all Loading... | |
| 33 ~Framer(); | 33 ~Framer(); |
| 34 | 34 |
| 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. If a duplicate packet for an already complete frame is | 36 // complete frame. If a duplicate packet for an already complete frame is |
| 37 // received, the function returns false but sets |duplicate| to true. | 37 // received, the function returns false but sets |duplicate| to true. |
| 38 bool InsertPacket(const uint8* payload_data, | 38 bool InsertPacket(const uint8* payload_data, |
| 39 size_t payload_size, | 39 size_t payload_size, |
| 40 const RtpCastHeader& rtp_header, | 40 const RtpCastHeader& rtp_header, |
| 41 bool* duplicate); | 41 bool* duplicate); |
| 42 | 42 |
| 43 // Extracts a complete encoded frame - will only return a complete continuous | 43 // Extracts a complete encoded frame - will only return a complete continuous |
|
imcheng
2014/05/14 20:11:24
From implementation it looks like this is not the
hubbe
2014/05/14 21:46:16
Done.
| |
| 44 // frame. | 44 // frame. |
| 45 // Returns false if the frame does not exist or if the frame is not complete | 45 // Returns false if the frame does not exist or if the frame is not complete |
| 46 // within the given time frame. | 46 // within the given time frame. |
| 47 bool GetEncodedVideoFrame(transport::EncodedVideoFrame* video_frame, | 47 bool GetEncodedVideoFrame(transport::EncodedVideoFrame* video_frame, |
| 48 bool* next_frame); | 48 bool* next_frame, |
|
imcheng
2014/05/14 20:11:24
What does |next_frame| mean?
hubbe
2014/05/14 21:46:16
Done.
| |
| 49 bool* have_multiple_complete_frames); | |
| 49 | 50 |
| 50 bool GetEncodedAudioFrame(transport::EncodedAudioFrame* audio_frame, | 51 bool GetEncodedAudioFrame(transport::EncodedAudioFrame* audio_frame, |
| 51 bool* next_frame); | 52 bool* next_frame); |
| 52 | 53 |
| 53 void ReleaseFrame(uint32 frame_id); | 54 void ReleaseFrame(uint32 frame_id); |
| 54 | 55 |
| 55 // Reset framer state to original state and flush all pending buffers. | 56 // Reset framer state to original state and flush all pending buffers. |
| 56 void Reset(); | 57 void Reset(); |
| 57 bool TimeToSendNextCastMessage(base::TimeTicks* time_to_send); | 58 bool TimeToSendNextCastMessage(base::TimeTicks* time_to_send); |
| 58 void SendCastMessage(); | 59 void SendCastMessage(); |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 const bool decoder_faster_than_max_frame_rate_; | 62 const bool decoder_faster_than_max_frame_rate_; |
| 62 FrameList frames_; | 63 FrameList frames_; |
| 63 FrameIdMap frame_id_map_; | 64 FrameIdMap frame_id_map_; |
| 64 | 65 |
| 65 scoped_ptr<CastMessageBuilder> cast_msg_builder_; | 66 scoped_ptr<CastMessageBuilder> cast_msg_builder_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(Framer); | 68 DISALLOW_COPY_AND_ASSIGN(Framer); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace cast | 71 } // namespace cast |
| 71 } // namespace media | 72 } // namespace media |
| 72 | 73 |
| 73 #endif // MEDIA_CAST_FRAMER_FRAMER_H_ | 74 #endif // MEDIA_CAST_FRAMER_FRAMER_H_ |
| OLD | NEW |