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_VIDEO_ENGINE_TEST_AUTO_TEST_PRIMITIVES_GENERAL_PRIMITIVES_H_ 12b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#define WEBRTC_VIDEO_ENGINE_TEST_AUTO_TEST_PRIMITIVES_GENERAL_PRIMITIVES_H_ 13b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 14b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass ViEToFileRenderer; 15b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 16281cff8cd679728fe395f7f0203c05e763c0c789pbos@webrtc.org#include "webrtc/common_types.h" 17b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 18b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgnamespace webrtc { 19b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass VideoCaptureModule; 20b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass ViEBase; 21b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass ViECapture; 22b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass ViECodec; 23b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass ViERender; 24b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass ViERTP_RTCP; 25b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgstruct VideoCodec; 26b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org} 27b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 28a0f23f156822760eab87325c52216be18f3b72bdstefan@webrtc.orgenum ProtectionMethod { 29a0f23f156822760eab87325c52216be18f3b72bdstefan@webrtc.org kNack, 30a0f23f156822760eab87325c52216be18f3b72bdstefan@webrtc.org kHybridNackFec, 31a0f23f156822760eab87325c52216be18f3b72bdstefan@webrtc.org}; 32a0f23f156822760eab87325c52216be18f3b72bdstefan@webrtc.org 33b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// This constant can be used as input to various functions to not force the 34b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// codec resolution. 35b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgconst int kDoNotForceResolution = 0; 36b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 37b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Finds a suitable capture device (e.g. camera) on the current system 38b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// and allocates it. Details about the found device are filled into the out 39b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// parameters. If this operation fails, device_id is assigned a negative value 40b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// and number_of_errors is incremented. 41b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgvoid FindCaptureDeviceOnSystem(webrtc::ViECapture* capture, 42b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org char* device_name, 43b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org const unsigned int kDeviceNameLength, 44b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org int* device_id, 45b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org webrtc::VideoCaptureModule** device_video); 46b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 47b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Sets up rendering in a window previously created using a Window Manager 48b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// (See vie_window_manager_factory.h for more details on how to make one of 49b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// those). The frame provider id is a source of video frames, for instance 50b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// a capture device or a video channel. 51b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgvoid RenderInWindow(webrtc::ViERender* video_render_interface, 52b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org int frame_provider_id, 53b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org void* os_window, 54b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org float z_index); 55b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 56b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Similar in function to RenderInWindow, this function instead renders to 57b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// a file using a to-file-renderer. The frame provider id is a source of 58b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// video frames, for instance a capture device or a video channel. 59b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgvoid RenderToFile(webrtc::ViERender* renderer_interface, 60b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org int frame_provider_id, 61b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org ViEToFileRenderer* to_file_renderer); 62b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 63b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Configures RTP-RTCP. 64b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgvoid ConfigureRtpRtcp(webrtc::ViERTP_RTCP* rtcp_interface, 65a0f23f156822760eab87325c52216be18f3b72bdstefan@webrtc.org ProtectionMethod protection_method, 66b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org int video_channel); 67b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 68b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Finds a codec in the codec list. Returns true on success, false otherwise. 69b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// The resulting codec is filled into result on success but is zeroed out 70b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// on failure. 71b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgbool FindSpecificCodec(webrtc::VideoCodecType of_type, 72b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org webrtc::ViECodec* codec_interface, 73b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org webrtc::VideoCodec* result); 74b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 75b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Sets up the provided codec with a resolution that takes individual codec 76b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// quirks into account (except if the forced* variables are 77b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// != kDoNotForceResolution) 78b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgvoid SetSuitableResolution(webrtc::VideoCodec* video_codec, 79b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org int forced_codec_width, 80b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org int forced_codec_height); 81b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 82b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#endif // WEBRTC_VIDEO_ENGINE_TEST_AUTO_TEST_PRIMITIVES_GENERAL_PRIMITIVES_H_ 83