<commit_before>/*****************************************************************************
*
*  Avi Import Component QuickTime Component Interface
*
*  Copyright(C) 2006 <NAME> <<EMAIL>>
*
*  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; either
*  version 2.1 of the License, or (at your option) any later version.
*  
*  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
*
****************************************************************************/

#include "ff_MovieImportVersion.h"
#include "ff_private.h"
#include "Codecprintf.h"
#include "riff.h"
#include "SubImport.h"

/* This one is a little big in ffmpeg and private anyway */
#define PROBE_BUF_SIZE 64

#include <CoreServices/CoreServices.h>
#include <QuickTime/QuickTime.h>

#define MOVIEIMPORT_BASENAME()		FFAvi_MovieImport
#define MOVIEIMPORT_GLOBALS()		ff_global_ptr storage

#define CALLCOMPONENT_BASENAME()	MOVIEIMPORT_BASENAME()
#define CALLCOMPONENT_GLOBALS()		MOVIEIMPORT_GLOBALS()

#define COMPONENT_DISPATCH_FILE		"ff_MovieImportDispatch.h"
#define COMPONENT_UPP_SELECT_ROOT()	MovieImport

#include <CoreServices/Components.k.h>
#include <QuickTime/QuickTimeComponents.k.h>
#include <QuickTime/ComponentDispatchHelper.c>

#pragma mark -

#define REGISTER_MUXER(x) { \
	extern AVOutputFormat x##_muxer; \
		av_register_output_format(&x##_muxer); }
#define REGISTER_DEMUXER(x) { \
	extern AVInputFormat x##_demuxer; \
		av_register_input_format(&x##_demuxer); }
#define REGISTER_MUXDEMUX(x)  REGISTER_MUXER(x); REGISTER_DEMUXER(x)
#define REGISTER_PROTOCOL(x) { \
	extern URLProtocol x##_protocol; \
		register_protocol(&x##_protocol); }

#define REGISTER_ENCODER(x) { \
	extern AVCodec x##_encoder; \
		register_avcodec(&x##_encoder); }
#define REGISTER_DECODER(x) { \
	extern AVCodec x##_decoder; \
		register_avcodec(&x##_decoder); }
#define REGISTER_ENCDEC(x)  REGISTER_ENCODER(x); REGISTER_DECODER(x)

#define REGISTER_PARSER(x) { \
	extern AVCodecParser x##_parser; \
		av_register_codec_parser(&x##_parser); }
#define REGISTER_BSF(x) { \
	extern AVBitStreamFilter x##_bsf; \
		av_register_bitstream_filter(&x##_bsf); }

void init_FFmpeg()
{
	/* This one is used because Global variables are initialized ONE time
	* until the application quits. Thus, we have to make sure we're initialize
	* the libavformat only once or we get an endlos loop when registering the same
	* element twice!! */
	static Boolean inited = FALSE;
	
	/* Register the Parser of ffmpeg, needed because we do no proper setup of the libraries */
	if(!inited) {
		inited = TRUE;
		REGISTER_DEMUXER(avi);<commit_msg>changed register_avcodec to avcodec_register<commit_after>/*****************************************************************************
*
*  Avi Import Component QuickTime Component Interface
*
*  Copyright(C) 2006 <NAME> <<EMAIL>>
*
*  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; either
*  version 2.1 of the License, or (at your option) any later version.
*  
*  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
*
****************************************************************************/

#include "ff_MovieImportVersion.h"
#include "ff_private.h"
#include "Codecprintf.h"
#include "riff.h"
#include "SubImport.h"

/* This one is a little big in ffmpeg and private anyway */
#define PROBE_BUF_SIZE 64

#include <CoreServices/CoreServices.h>
#include <QuickTime/QuickTime.h>

#define MOVIEIMPORT_BASENAME()		FFAvi_MovieImport
#define MOVIEIMPORT_GLOBALS()		ff_global_ptr storage

#define CALLCOMPONENT_BASENAME()	MOVIEIMPORT_BASENAME()
#define CALLCOMPONENT_GLOBALS()		MOVIEIMPORT_GLOBALS()

#define COMPONENT_DISPATCH_FILE		"ff_MovieImportDispatch.h"
#define COMPONENT_UPP_SELECT_ROOT()	MovieImport

#include <CoreServices/Components.k.h>
#include <QuickTime/QuickTimeComponents.k.h>
#include <QuickTime/ComponentDispatchHelper.c>

#pragma mark -

#define REGISTER_MUXER(x) { \
	extern AVOutputFormat x##_muxer; \
		av_register_output_format(&x##_muxer); }
#define REGISTER_DEMUXER(x) { \
	extern AVInputFormat x##_demuxer; \
		av_register_input_format(&x##_demuxer); }
#define REGISTER_MUXDEMUX(x)  REGISTER_MUXER(x); REGISTER_DEMUXER(x)
#define REGISTER_PROTOCOL(x) { \
	extern URLProtocol x##_protocol; \
		register_protocol(&x##_protocol); }

#define REGISTER_ENCODER(x) { \
	extern AVCodec x##_encoder; \
		register_avcodec(&x##_encoder); }
#define REGISTER_DECODER(x) { \
	extern AVCodec x##_decoder; \
		avcodec_register(&x##_decoder); }
#define REGISTER_ENCDEC(x)  REGISTER_ENCODER(x); REGISTER_DECODER(x)

#define REGISTER_PARSER(x) { \
	extern AVCodecParser x##_parser; \
		av_register_codec_parser(&x##_parser); }
#define REGISTER_BSF(x) { \
	extern AVBitStreamFilter x##_bsf; \
		av_register_bitstream_filter(&x##_bsf); }

void init_FFmpeg()
{
	/* This one is used because Global variables are initialized ONE time
	* until the application quits. Thus, we have to make sure we're initialize
	* the libavformat only once or we get an endlos loop when registering the same
	* element twice!! */
	static Boolean inited = FALSE;
	
	/* Register the Parser of ffmpeg, needed because we do no proper setup of the libraries */
	if(!inited) {
		inited = TRUE;
		REGISTER_DEMUXER(avi);
{'fraction_non_alphanumeric': 0.1406971192105682, 'fraction_numerical': 0.00604806621040904, 'mean_word_length': 5.545833333333333, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '7438993', 'n_tokens_mistral': 2100, 'n_tokens_neox': 2005, 'n_words': 594}