Home | History | Annotate | Download | only in include
      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 WEBRTC_MODULES_VIDEO_RENDER_MAIN_INTERFACE_VIDEO_RENDER_DEFINES_H_
     12 #define WEBRTC_MODULES_VIDEO_RENDER_MAIN_INTERFACE_VIDEO_RENDER_DEFINES_H_
     13 
     14 // Includes
     15 #include "webrtc/common_types.h"
     16 #include "webrtc/common_video/interface/i420_video_frame.h"
     17 #include "webrtc/modules/interface/module_common_types.h"
     18 
     19 namespace webrtc
     20 {
     21 // Defines
     22 #ifndef NULL
     23 #define NULL    0
     24 #endif
     25 
     26 // Enums
     27 enum VideoRenderType
     28 {
     29     kRenderExternal = 0, // External
     30     kRenderWindows = 1, // Windows
     31     kRenderCocoa = 2, // Mac
     32     kRenderCarbon = 3,
     33     kRenderiOS = 4, // iPhone
     34     kRenderAndroid = 5, // Android
     35     kRenderX11 = 6, // Linux
     36     kRenderDefault
     37 };
     38 
     39 // Runtime errors
     40 enum VideoRenderError
     41 {
     42     kRenderShutDown = 0,
     43     kRenderPerformanceAlarm = 1
     44 };
     45 
     46 // The object a module user uses to send new frames to the renderer
     47 // One object is used for each incoming stream
     48 class VideoRenderCallback
     49 {
     50 public:
     51     virtual int32_t RenderFrame(const uint32_t streamId,
     52                                 I420VideoFrame& videoFrame) = 0;
     53 
     54 protected:
     55     virtual ~VideoRenderCallback()
     56     {
     57     }
     58 };
     59 
     60 // Feedback class to be implemented by module user
     61 class VideoRenderFeedback
     62 {
     63 public:
     64     virtual void OnRenderError(const int32_t streamId,
     65                                const VideoRenderError error) = 0;
     66 
     67 protected:
     68     virtual ~VideoRenderFeedback()
     69     {
     70     }
     71 };
     72 
     73 // Mobile enums
     74 enum StretchMode
     75 {
     76     kStretchToInsideEdge = 1,
     77     kStretchToOutsideEdge = 2,
     78     kStretchMatchWidth = 3,
     79     kStretchMatchHeight = 4,
     80     kStretchNone = 5
     81 };
     82 
     83 enum Rotation
     84 {
     85     kRotation0 = 0,
     86     kRotation90 = 1,
     87     kRotation180 = 2,
     88     kRotation270 = 3
     89 };
     90 
     91 }  // namespace webrtc
     92 
     93 #endif  // WEBRTC_MODULES_VIDEO_RENDER_MAIN_INTERFACE_VIDEO_RENDER_DEFINES_H_
     94