Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / rtp_rtcp / source / rtp_format_vp8.h
index e4d3dc0..755d19e 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "webrtc/base/constructormagic.h"
 #include "webrtc/modules/interface/module_common_types.h"
+#include "webrtc/modules/rtp_rtcp/source/rtp_format.h"
 #include "webrtc/typedefs.h"
 
 namespace webrtc {
@@ -44,25 +45,24 @@ enum VP8PacketizerMode {
 };
 
 // Packetizer for VP8.
-class RtpFormatVp8 {
+class RtpPacketizerVp8 : public RtpPacketizer {
  public:
   // Initialize with payload from encoder and fragmentation info.
   // The payload_data must be exactly one encoded VP8 frame.
-  RtpFormatVp8(const uint8_t* payload_data,
-               uint32_t payload_size,
-               const RTPVideoHeaderVP8& hdr_info,
-               int max_payload_len,
-               const RTPFragmentationHeader& fragmentation,
-               VP8PacketizerMode mode);
+  RtpPacketizerVp8(const RTPVideoHeaderVP8& hdr_info,
+                   int max_payload_len,
+                   VP8PacketizerMode mode);
 
   // Initialize without fragmentation info. Mode kEqualSize will be used.
   // The payload_data must be exactly one encoded VP8 frame.
-  RtpFormatVp8(const uint8_t* payload_data,
-               uint32_t payload_size,
-               const RTPVideoHeaderVP8& hdr_info,
-               int max_payload_len);
+  RtpPacketizerVp8(const RTPVideoHeaderVP8& hdr_info, int max_payload_len);
 
-  ~RtpFormatVp8();
+  virtual ~RtpPacketizerVp8();
+
+  virtual void SetPayloadData(
+      const uint8_t* payload_data,
+      size_t payload_size,
+      const RTPFragmentationHeader* fragmentation) OVERRIDE;
 
   // Get the next payload with VP8 payload header.
   // max_payload_len limits the sum length of payload and VP8 payload header.
@@ -75,9 +75,9 @@ class RtpFormatVp8 {
   // the first payload byte in the packet is taken, with the first partition
   // having index 0; returns negative on error.
   // For the kEqualSize mode: returns 0 on success, return negative on error.
-  int NextPacket(uint8_t* buffer,
-                 int* bytes_to_send,
-                 bool* last_packet);
+  virtual bool NextPacket(uint8_t* buffer,
+                          size_t* bytes_to_send,
+                          bool* last_packet) OVERRIDE;
 
  private:
   typedef struct {
@@ -187,7 +187,7 @@ class RtpFormatVp8 {
   bool PictureIdPresent() const { return (PictureIdLength() > 0); }
 
   const uint8_t* payload_data_;
-  const int payload_size_;
+  int payload_size_;
   RTPFragmentationHeader part_info_;
   const int vp8_fixed_payload_descriptor_bytes_;  // Length of VP8 payload
                                                   // descriptors's fixed part.
@@ -195,14 +195,12 @@ class RtpFormatVp8 {
   const bool balance_;
   const bool separate_first_;
   const RTPVideoHeaderVP8 hdr_info_;
-  const int num_partitions_;
+  int num_partitions_;
   const int max_payload_len_;
   InfoQueue packets_;
   bool packets_calculated_;
 
-  DISALLOW_COPY_AND_ASSIGN(RtpFormatVp8);
+  DISALLOW_COPY_AND_ASSIGN(RtpPacketizerVp8);
 };
-
 }  // namespace
-
 #endif  // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VP8_H_