<commit_before>/*
 * Copyright (C) 2007-2010 Nokia Corporation
 * Copyright (C) 2009 <NAME>
 *
 * Authors:
 * <NAME> <<EMAIL>>
 * <NAME> <<EMAIL>>
 *
 * This file may be used under the terms of the GNU Lesser General Public
 * License version 2.1, a copy of which is found in LICENSE included in the
 * packaging of this file.
 */

#include <gst/gst.h>
#include "gstdspbase.h"
#include "gstdspvdec.h"
#include "gstdspparse.h"

static inline void
set_framesize(GstDspBase *base,
	      gint width,
	      gint height)
{
	GstDspVDec *vdec = GST_DSP_VDEC(base);
	/* update the framesize only if it hasn't been set yet. */
	if (vdec->width == 0 || vdec->height == 0) {
		GstCaps *out_caps;
		GstStructure *struc;

		out_caps = base->tmp_caps;
		struc = gst_caps_get_structure(out_caps, 0);
		gst_structure_set(struc,
				  "width", G_TYPE_INT, width,
				  "height", G_TYPE_INT, height, NULL);
	}

	if (vdec->color_format == GST_MAKE_FOURCC('U', 'Y', 'V', 'Y'))
		base->output_buffer_size = width * height * 2;
	else
		base->output_buffer_size = width * height * 3 / 2;
	vdec->width = width;<commit_msg>parse: properly update crop framesize<commit_after>/*
 * Copyright (C) 2007-2010 Nokia Corporation
 * Copyright (C) 2009 <NAME>
 *
 * Authors:
 * <NAME> <<EMAIL>>
 * <NAME> <<EMAIL>>
 *
 * This file may be used under the terms of the GNU Lesser General Public
 * License version 2.1, a copy of which is found in LICENSE included in the
 * packaging of this file.
 */

#include <gst/gst.h>
#include "gstdspbase.h"
#include "gstdspvdec.h"
#include "gstdspparse.h"

static inline void
set_framesize(GstDspBase *base,
	      gint width,
	      gint height)
{
	GstDspVDec *vdec = GST_DSP_VDEC(base);

	/* update the framesize only if it hasn't been set yet. */
	if (vdec->crop_width == 0 || vdec->crop_height == 0) {
		GstCaps *out_caps;
		GstStructure *struc;

		out_caps = base->tmp_caps;
		struc = gst_caps_get_structure(out_caps, 0);
		gst_structure_set(struc,
				  "width", G_TYPE_INT, width,
				  "height", G_TYPE_INT, height, NULL);
		vdec->crop_width = width;
		vdec->crop_height = height;
	}

	if (vdec->color_format == GST_MAKE_FOURCC('U', 'Y', 'V', 'Y'))
		base->output_buffer_size = width * height * 2;
	else
		base->output_buffer_size = width * height * 3 / 2;
	vdec->width = width;
{'fraction_non_alphanumeric': 0.13574858140549978, 'fraction_numerical': 0.017459624618070713, 'mean_word_length': 3.794979079497908, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5278709', 'n_tokens_mistral': 946, 'n_tokens_neox': 855, 'n_words': 241}