Home | History | Annotate | Download | only in interface
      1 /*
      2  *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 #ifndef COMMON_VIDEO_INTERFACE_VIDEO_IMAGE_H
     12 #define COMMON_VIDEO_INTERFACE_VIDEO_IMAGE_H
     13 
     14 #include <stdlib.h>
     15 #include "webrtc/typedefs.h"
     16 
     17 namespace webrtc
     18 {
     19 
     20 enum VideoFrameType
     21 {
     22     kKeyFrame = 0,
     23     kDeltaFrame = 1,
     24     kGoldenFrame = 2,
     25     kAltRefFrame = 3,
     26     kSkipFrame = 4
     27 };
     28 
     29 class EncodedImage
     30 {
     31 public:
     32     EncodedImage()
     33         : _encodedWidth(0),
     34           _encodedHeight(0),
     35           _timeStamp(0),
     36           capture_time_ms_(0),
     37           _frameType(kDeltaFrame),
     38           _buffer(NULL),
     39           _length(0),
     40           _size(0),
     41           _completeFrame(false) {}
     42 
     43     EncodedImage(uint8_t* buffer,
     44                  uint32_t length,
     45                  uint32_t size)
     46         : _encodedWidth(0),
     47           _encodedHeight(0),
     48           _timeStamp(0),
     49           ntp_time_ms_(0),
     50           capture_time_ms_(0),
     51           _frameType(kDeltaFrame),
     52           _buffer(buffer),
     53           _length(length),
     54           _size(size),
     55           _completeFrame(false) {}
     56 
     57     uint32_t                    _encodedWidth;
     58     uint32_t                    _encodedHeight;
     59     uint32_t                    _timeStamp;
     60     // NTP time of the capture time in local timebase in milliseconds.
     61     int64_t ntp_time_ms_;
     62     int64_t                      capture_time_ms_;
     63     VideoFrameType              _frameType;
     64     uint8_t*                    _buffer;
     65     uint32_t                    _length;
     66     uint32_t                    _size;
     67     bool                        _completeFrame;
     68 };
     69 
     70 }  // namespace webrtc
     71 
     72 #endif // COMMON_VIDEO_INTERFACE_VIDEO_IMAGE_H
     73