Graphics framework for GR-PEACH. When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

Dependents:   ImageZoomInout_Sample ImageRotaion_Sample ImageScroll_Sample GR-PEACH_LCD_4_3inch_Save_to_USB ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers video_input_cpp.cpp Source File

video_input_cpp.cpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * DISCLAIMER
00003 * This software is supplied by Renesas Electronics Corporation and is only
00004 * intended for use with Renesas products. No other uses are authorized. This
00005 * software is owned by Renesas Electronics Corporation and is protected under
00006 * all applicable laws, including copyright laws.
00007 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
00008 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
00009 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
00010 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
00011 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
00012 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
00013 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
00014 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
00015 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
00016 * Renesas reserves the right, without notice, to make changes to this software
00017 * and to discontinue the availability of this software. By using this software,
00018 * you agree to the additional terms and conditions found by accessing the
00019 * following link:
00020 * http://www.renesas.com/disclaimer
00021 * Copyright (C) 2014 - 2015 Renesas Electronics Corporation. All rights reserved.
00022 *******************************************************************************/
00023 /**
00024 * @file  video_input_cpp.cpp
00025 * @brief   $Rev: 51 $
00026 * $Date:: 2014-03-14 18:42:33 +0900#$
00027 */
00028 
00029 
00030 /******************************************************************************
00031 Includes   <System Includes> , "Project Includes"
00032 *******************************************************************************/
00033 #include  "video_input.hpp "
00034 #include  "video_input.h "
00035 #include  "r_ospl.h"
00036 
00037 
00038 /******************************************************************************
00039 Typedef definitions
00040 ******************************************************************************/
00041 
00042 /******************************************************************************
00043 Macro definitions
00044 ******************************************************************************/
00045 #define  GS_DEFAULT_INT_VALUE  -1
00046 
00047 
00048 /******************************************************************************
00049 Imported global variables and functions (from other files)
00050 ******************************************************************************/
00051 
00052 /******************************************************************************
00053 Exported global variables and functions (to be accessed by other files)
00054 ******************************************************************************/
00055 
00056 /******************************************************************************
00057 Private global variables and functions
00058 ******************************************************************************/
00059 
00060 /***********************************************************************
00061 * ClassImplement: VideoInput
00062 ************************************************************************/
00063 
00064 /***********************************************************************
00065 * Implement: VideoInput
00066 ************************************************************************/
00067 VideoInput::VideoInput()
00068 {
00069     this->_self = NULL;
00070 }
00071 
00072 
00073 /***********************************************************************
00074 * Implement: ~VideoInput
00075 ************************************************************************/
00076 VideoInput::~VideoInput()
00077 {
00078     this->destroy();
00079 }
00080 
00081 
00082 /***********************************************************************
00083 * Implement: initialize
00084 ************************************************************************/
00085 errnum_t  VideoInput::initialize( VideoInputConfig &in_out_config )
00086 {
00087     this->_self = new  video_input_t;
00088     ASSERT_R( this->_self != NULL,  return  E_FEW_MEMORY );
00089 
00090     in_out_config.flags =
00091         VIDEO_INPUT_CONFIG_T_VIDEO_INPUT_CHANNEL_NUM |
00092         VIDEO_INPUT_CONFIG_T_DISPLAY_CHANNEL_NUM |
00093         VIDEO_INPUT_CONFIG_T_DISPLAY_LAYER_NUM |
00094         VIDEO_INPUT_CONFIG_T_FRAME_BUFFER |
00095         VIDEO_INPUT_CONFIG_T_CAPTURED_ASYNC;
00096 
00097     if ( in_out_config.video_input_channel_num == GS_DEFAULT_INT_VALUE ) {
00098         in_out_config.flags &= ~VIDEO_INPUT_CONFIG_T_VIDEO_INPUT_CHANNEL_NUM;
00099     }
00100     if ( in_out_config.display_channel_num == GS_DEFAULT_INT_VALUE ) {
00101         in_out_config.flags &= ~VIDEO_INPUT_CONFIG_T_DISPLAY_CHANNEL_NUM;
00102     }
00103     if ( in_out_config.display_layer_num == GS_DEFAULT_INT_VALUE ) {
00104         in_out_config.flags &= ~VIDEO_INPUT_CONFIG_T_DISPLAY_LAYER_NUM;
00105     }
00106     if ( in_out_config.frame_buffer == NULL ) {
00107         in_out_config.flags &= ~VIDEO_INPUT_CONFIG_T_FRAME_BUFFER;
00108     }
00109     if ( in_out_config.captured_async == NULL ) {
00110         in_out_config.flags &= ~VIDEO_INPUT_CONFIG_T_CAPTURED_ASYNC;
00111     }
00112 
00113     return  R_VIDEO_INPUT_Initialize( this->_self,  (video_input_config_t *) &in_out_config );
00114 }
00115 
00116 
00117 /***********************************************************************
00118 * Implement: destroy
00119 ************************************************************************/
00120 void  VideoInput::destroy()
00121 {
00122     if ( this->_self != NULL ) {
00123         errnum_t  e = R_VIDEO_INPUT_Finalize( this->_self,  0 );
00124         ASSERT_R( e == 0,  R_NOOP() );
00125     }
00126 }
00127 
00128 
00129 /***********************************************************************
00130 * ClassImplement: VideoInputConfig
00131 ************************************************************************/
00132 
00133 /***********************************************************************
00134 * Implement: VideoInputConfig
00135 ************************************************************************/
00136 VideoInputConfig::VideoInputConfig()
00137 {
00138     this->flags = 0;
00139     this->video_input_channel_num = GS_DEFAULT_INT_VALUE;
00140     this->display_channel_num = GS_DEFAULT_INT_VALUE;
00141     this->display_layer_num = GS_DEFAULT_INT_VALUE;
00142     this->frame_buffer = NULL;
00143     this->captured_async = NULL;
00144 }
00145 
00146