1b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org/*
2b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *
4b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  Use of this source code is governed by a BSD-style license
5b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  that can be found in the LICENSE file in the root of the source
6b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  tree. An additional intellectual property rights grant can be found
7b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  in the file PATENTS.  All contributing project authors may
8b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  be found in the AUTHORS file in the root of the source tree.
9b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org */
10b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
11b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#ifndef WEBRTC_MODULES_VIDEO_RENDER_MAIN_INTERFACE_VIDEO_RENDER_DEFINES_H_
12b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#define WEBRTC_MODULES_VIDEO_RENDER_MAIN_INTERFACE_VIDEO_RENDER_DEFINES_H_
13b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
14b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Includes
157e5dc8741fbd5f07a709e6fd4d2cd8b08b7cee94pbos@webrtc.org#include "webrtc/common_types.h"
167e5dc8741fbd5f07a709e6fd4d2cd8b08b7cee94pbos@webrtc.org#include "webrtc/common_video/interface/i420_video_frame.h"
177e5dc8741fbd5f07a709e6fd4d2cd8b08b7cee94pbos@webrtc.org#include "webrtc/modules/interface/module_common_types.h"
18b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
19b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgnamespace webrtc
20b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org{
21b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Defines
22b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#ifndef NULL
23b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#define NULL    0
24b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#endif
25b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
26b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Enums
27b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgenum VideoRenderType
28b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org{
29b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRenderExternal = 0, // External
30b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRenderWindows = 1, // Windows
31b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRenderCocoa = 2, // Mac
32b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRenderCarbon = 3,
33bc375b56d1d38a5b99d5cc726e1da098b5da969dfischman@webrtc.org    kRenderiOS = 4, // iPhone
34b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRenderAndroid = 5, // Android
35b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRenderX11 = 6, // Linux
36b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRenderDefault
37b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org};
38b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
39b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Runtime errors
40b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgenum VideoRenderError
41b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org{
42b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRenderShutDown = 0,
43b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRenderPerformanceAlarm = 1
44b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org};
45b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
46b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// The object a module user uses to send new frames to the renderer
47b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// One object is used for each incoming stream
48b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass VideoRenderCallback
49b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org{
50b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgpublic:
51e1ca446434022ad0d05ebd5ed2feafb08ae940e3pbos@webrtc.org    virtual int32_t RenderFrame(const uint32_t streamId,
52e1ca446434022ad0d05ebd5ed2feafb08ae940e3pbos@webrtc.org                                I420VideoFrame& videoFrame) = 0;
53b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
54b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgprotected:
55b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    virtual ~VideoRenderCallback()
56b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    {
57b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    }
58b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org};
59b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
60b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Feedback class to be implemented by module user
61b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass VideoRenderFeedback
62b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org{
63b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgpublic:
64e1ca446434022ad0d05ebd5ed2feafb08ae940e3pbos@webrtc.org    virtual void OnRenderError(const int32_t streamId,
65b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org                               const VideoRenderError error) = 0;
66b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
67b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgprotected:
68b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    virtual ~VideoRenderFeedback()
69b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    {
70b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    }
71b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org};
72b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
73b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Mobile enums
74b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgenum StretchMode
75b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org{
76b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kStretchToInsideEdge = 1,
77b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kStretchToOutsideEdge = 2,
78b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kStretchMatchWidth = 3,
79b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kStretchMatchHeight = 4,
80b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kStretchNone = 5
81b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org};
82b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
83b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgenum Rotation
84b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org{
85b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRotation0 = 0,
86b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRotation90 = 1,
87b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRotation180 = 2,
88b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    kRotation270 = 3
89b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org};
90b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
913b89e10f31160da35b408fd00cb8f89d2b08862dpbos@webrtc.org}  // namespace webrtc
92b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
93b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#endif  // WEBRTC_MODULES_VIDEO_RENDER_MAIN_INTERFACE_VIDEO_RENDER_DEFINES_H_
94