<commit_before>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

/*
 * Copyright (C) 2008 Texas Instruments - http://www.ti.com/
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation
 * version 2.1 of the License.
 *
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <gst/interfaces/colorbalance.h>
#include <gst/base/gstbasetransform.h>
#include <gst/video/video.h>

#include <goo-ti-camera.h>

#include "gstgoocamera.h"
#include "gstghostbuffer.h"
#include "gstgoobuffer.h"
#include "string.h"

GST_DEBUG_CATEGORY_STATIC (gst_goo_camera_debug);
#define GST_CAT_DEFAULT gst_goo_camera_debug

/* signals */
enum
{
	LAST_SIGNAL
};

/* args */
enum
{
	PROP_0,
	PROP_NUM_OUTPUT_BUFFERS,
	PROP_PREVIEW,
	PROP_DISPLAY_WIDTH,
	PROP_DISPLAY_HEIGHT,
	PROP_DISPLAY_POS_X,
	PROP_DISPLAY_POS_Y,
	PROP_DISPLAY_ROTATION,
	PROP_DISPLAY_VIDEOPIPELINE,
	PROP_OUTPUT_DEVICE,
	PROP_CONTRAST,
	PROP_BRIGHTNESS,
	PROP_ZOOM,
	PROP_BALANCE,
	PROP_EXPOSURE,
	PROP_VSTAB,
	PROP_FOCUS,
	PROP_EFFECTS,
	PROP_IPP,
	PROP_IMAGECAP
};

#define GST_GOO_CAMERA_GET_PRIVATE(obj) (GST_GOO_CAMERA (obj)->priv)

struct _GstGooCameraPrivate
{
	gboolean preview;
	guint video_pipeline;
	guint outcount;
	guint display_height;
	guint display_width;
	guint capture;
	gint fps_n, fps_d;
	gboolean vstab;
	gint zoom;
	gint focus;
	gint effects;
	gint exposure;
	gboolean ipp;
	gboolean image;
	guint output_buffers;
};

static const GstElementDetails details =
	GST_ELEMENT_DETAILS (
		"OpenMAX camera source",
		"Source/Video",
		"Capture raw frames through the OpenMAX camera component",
		"Texas Instrument"
		);

static GstStaticPadTemplate src_factory =
	GST_STATIC_PAD_TEMPLATE (
		"src",
		GST_PAD_SRC,
		GST_PAD_ALWAYS,
		GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ YUY2, UYVY  }") ";"
				 GST_VIDEO_CAPS_RGB_16)
		);

/* the max resolution of the postprocessor */
ResolutionInfo maxres;

#define NUM_OUTPUT_BUFFERS_DEFAULT 4
#define PREVIEW_DEFAULT		       TRUE
#define OUTPUT_DEFAULT	      	   GOO_TI_POST_PROCESSOR_OUTPUT_LCD
#define VIDEOPIPELINE_DEFAULT      2
#define DISPLAY_WIDTH_DEFAULT      320
#define DISPLAY_HEIGHT_DEFAULT     240
#define DISPLAY_POSX_DEFAULT       0
#define DISPLAY_POSY_DEFAULT       0
#define COLOR_DEFAULT              OMX_COLOR_FormatYCbYCr
#define BALANCE_DEFAULT            OMX_WhiteBalControlAuto
#define EXPOSURE_DEFAULT   		   OMX_ExposureControlAuto
#define ZOOM_DEFAULT               GOO_TI_CAMERA_ZOOM_1X
#define CONTRAST_DEFAULT	       0
#define BRIGHTNESS_DEFAULT	       50
#define DISPLAY_ROTATION_DEFAULT   GOO_TI_POST_PROCESSOR_ROTATION_NONE
#define VSTAB_DEFAULT              FALSE
#define FOCUS_DEFAULT              OMX_CameraConfigFocusStopFocus
#define EFFECTS_DEFAULT			   OMX_CameraConfigEffectsNormal
#define CONTRAST_LABEL		   "Contrast"<commit_msg>goocamera: Default to 6 output buffers.<commit_after>/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

/*
 * Copyright (C) 2008 Texas Instruments - http://www.ti.com/
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation
 * version 2.1 of the License.
 *
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <gst/interfaces/colorbalance.h>
#include <gst/base/gstbasetransform.h>
#include <gst/video/video.h>

#include <goo-ti-camera.h>

#include "gstgoocamera.h"
#include "gstghostbuffer.h"
#include "gstgoobuffer.h"
#include "string.h"

GST_DEBUG_CATEGORY_STATIC (gst_goo_camera_debug);
#define GST_CAT_DEFAULT gst_goo_camera_debug

/* signals */
enum
{
	LAST_SIGNAL
};

/* args */
enum
{
	PROP_0,
	PROP_NUM_OUTPUT_BUFFERS,
	PROP_PREVIEW,
	PROP_DISPLAY_WIDTH,
	PROP_DISPLAY_HEIGHT,
	PROP_DISPLAY_POS_X,
	PROP_DISPLAY_POS_Y,
	PROP_DISPLAY_ROTATION,
	PROP_DISPLAY_VIDEOPIPELINE,
	PROP_OUTPUT_DEVICE,
	PROP_CONTRAST,
	PROP_BRIGHTNESS,
	PROP_ZOOM,
	PROP_BALANCE,
	PROP_EXPOSURE,
	PROP_VSTAB,
	PROP_FOCUS,
	PROP_EFFECTS,
	PROP_IPP,
	PROP_IMAGECAP
};

#define GST_GOO_CAMERA_GET_PRIVATE(obj) (GST_GOO_CAMERA (obj)->priv)

struct _GstGooCameraPrivate
{
	gboolean preview;
	guint video_pipeline;
	guint outcount;
	guint display_height;
	guint display_width;
	guint capture;
	gint fps_n, fps_d;
	gboolean vstab;
	gint zoom;
	gint focus;
	gint effects;
	gint exposure;
	gboolean ipp;
	gboolean image;
	guint output_buffers;
};

static const GstElementDetails details =
	GST_ELEMENT_DETAILS (
		"OpenMAX camera source",
		"Source/Video",
		"Capture raw frames through the OpenMAX camera component",
		"Texas Instrument"
		);

static GstStaticPadTemplate src_factory =
	GST_STATIC_PAD_TEMPLATE (
		"src",
		GST_PAD_SRC,
		GST_PAD_ALWAYS,
		GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("{ YUY2, UYVY  }") ";"
				 GST_VIDEO_CAPS_RGB_16)
		);

/* the max resolution of the postprocessor */
ResolutionInfo maxres;

#define NUM_OUTPUT_BUFFERS_DEFAULT 6
#define PREVIEW_DEFAULT		       TRUE
#define OUTPUT_DEFAULT	      	   GOO_TI_POST_PROCESSOR_OUTPUT_LCD
#define VIDEOPIPELINE_DEFAULT      2
#define DISPLAY_WIDTH_DEFAULT      320
#define DISPLAY_HEIGHT_DEFAULT     240
#define DISPLAY_POSX_DEFAULT       0
#define DISPLAY_POSY_DEFAULT       0
#define COLOR_DEFAULT              OMX_COLOR_FormatYCbYCr
#define BALANCE_DEFAULT            OMX_WhiteBalControlAuto
#define EXPOSURE_DEFAULT   		   OMX_ExposureControlAuto
#define ZOOM_DEFAULT               GOO_TI_CAMERA_ZOOM_1X
#define CONTRAST_DEFAULT	       0
#define BRIGHTNESS_DEFAULT	       50
#define DISPLAY_ROTATION_DEFAULT   GOO_TI_POST_PROCESSOR_ROTATION_NONE
#define VSTAB_DEFAULT              FALSE
#define FOCUS_DEFAULT              OMX_CameraConfigFocusStopFocus
#define EFFECTS_DEFAULT			   OMX_CameraConfigEffectsNormal
#define CONTRAST_LABEL		   "Contrast"
{'fraction_non_alphanumeric': 0.07188591385331781, 'fraction_numerical': 0.010913853317811409, 'mean_word_length': 4.340326340326341, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2180170', 'n_tokens_mistral': 2591, 'n_tokens_neox': 2463, 'n_words': 618}