Exemple #1
0
QStringList Version::dependencyVersions() {
    // WARNING: may be inaccurate since some come from compile-time header
    // definitions instead of the actual dynamically loaded library).
    QStringList result;
    result
            // Should be accurate.
            << QString("Qt: %1").arg(qVersion())
#ifdef __SHOUTCAST__
            // Should be accurate.
            << QString("libshout: %1").arg(shout_version(NULL, NULL, NULL))
#endif
#ifdef __PORTAUDIO__
            << QString("PortAudio: %1 %2").arg(Pa_GetVersion()).arg(Pa_GetVersionText())
#endif
            // The version of the RubberBand headers Mixxx was compiled with.
            << QString("RubberBand: %1").arg(RUBBERBAND_VERSION)
            // The version of the SoundTouch headers Mixxx was compiled with.
            << QString("SoundTouch: %1").arg(SOUNDTOUCH_VERSION)
            // The version of the TagLib headers Mixxx was compiled with.
            << QString("TagLib: %1.%2.%3").arg(QString::number(TAGLIB_MAJOR_VERSION),
                                               QString::number(TAGLIB_MINOR_VERSION),
                                               QString::number(TAGLIB_PATCH_VERSION))
            // The version of the ChromaPrint headers Mixxx was compiled with.
            << QString("ChromaPrint: %1.%2.%3").arg(QString::number(CHROMAPRINT_VERSION_MAJOR),
                                                    QString::number(CHROMAPRINT_VERSION_MINOR),
                                                    QString::number(CHROMAPRINT_VERSION_PATCH))
            // Should be accurate.
            << QString("Vorbis: %1").arg(vorbis_version_string())
            // The version of the FLAC headers Mixxx was compiled with.
            << QString("FLAC: %1").arg(FLAC__VERSION_STRING);

    return result;
}
Exemple #2
0
	Manager::Manager() : defaultPrecachedFramesCount(8), workMutex(new Mutex()), audioInterfaceFactory(NULL)
	{
		std::string message = "Initializing Theoraplayer Video Playback Library (" + this->getVersionString() + ")\n";
#ifdef _USE_THEORA
		message += "  - libtheora version: " + std::string(th_version_string()) + "\n" +
			"  - libvorbis version: " + std::string(vorbis_version_string()) + "\n";
#endif
#ifdef _ANDROID
		uint64_t features = libtheoraplayer_android_getCpuFeaturesExt();
		char s[128] = { 0 };
		sprintf(s, "  - Android: CPU Features: %u\n", (unsigned int)features);
		message += s;
		if ((features & ANDROID_CPU_ARM_FEATURE_NEON) == 0)
		{
			message += "  - Android: NEON features NOT SUPPORTED by CPU\n";
		}
		else
		{
			message += "  - Android: Detected NEON CPU features\n";
		}
#endif
		log(message + "------------------------------------");
		// for CPU based yuv2rgb decoding
		initYUVConversionModule();
	}
Exemple #3
0
void init_stream_vorbis(void) {
	vorbis_stream_tag = scm_make_smob_type("vorbis_stream",
			sizeof(VORBIS_STREAM));
	scm_set_smob_free(vorbis_stream_tag, free_vorbis);
	scm_c_define_gsubr("stream-vorbis", 4, 0, 1, open_vorbis_stream);
	log_msg("Ogg Vorbis version %s\n", vorbis_version_string());
	return;
	}
Exemple #4
0
TheoraVideoManager::TheoraVideoManager(int num_worker_threads) :
    mDefaultNumPrecachedFrames(8)
{
    if (num_worker_threads < 1) throw TheoraGenericException("Unable to create TheoraVideoManager, at least one worker thread is reqired");

    g_ManagerSingleton = this;

    std::string msg = "Initializing Theora Playback Library (" + getVersionString() + ")\n";
#ifdef __THEORA
    msg += "  - libtheora version: " + std::string(th_version_string()) + "\n" +
           "  - libvorbis version: " +  std::string(vorbis_version_string()) + "\n";
#endif
#ifdef _ANDROID
    uint64_t features = android_getCpuFeaturesExt();
    char s[128];
    sprintf(s, "  - Android: CPU Features: %u\n", (unsigned int) features);
    msg += s;
    if ((features & ANDROID_CPU_ARM_FEATURE_NEON) == 0)
        msg += "  - Android: NEON features NOT SUPPORTED by CPU\n";
    else
        msg += "  - Android: Detected NEON CPU features\n";
#endif

#ifdef __AVFOUNDATION
    msg += "  - using Apple AVFoundation classes.\n";
#endif
#ifdef __FFMPEG
    msg += "  - using FFmpeg library.\n";
#endif

    logMessage(msg + "------------------------------------");
    mAudioFactory = NULL;
    mWorkMutex = new TheoraMutex();

    // for CPU based yuv2rgb decoding
    initYUVConversionModule();

    createWorkerThreads(num_worker_threads);
}
Exemple #5
0
QStringList Version::dependencyVersions() {
    char sndfile_version[128];
    sf_command(nullptr, SFC_GET_LIB_VERSION, sndfile_version, sizeof(sndfile_version));
    // Null-terminate just in case.
    sndfile_version[sizeof(sndfile_version) - 1] = '\0';
    // WARNING: may be inaccurate since some come from compile-time header
    // definitions instead of the actual dynamically loaded library).
    QStringList result;
    result
            // Should be accurate.
            << QString("Qt: %1").arg(qVersion())
#ifdef __BROADCAST__
            // Should be accurate.
            << QString("libshout: %1").arg(shout_version(NULL, NULL, NULL))
#endif
            << QString("PortAudio: %1 %2").arg(Pa_GetVersion()).arg(Pa_GetVersionText())
            // The version of the RubberBand headers Mixxx was compiled with.
            << QString("RubberBand: %1").arg(RUBBERBAND_VERSION)
            // The version of the SoundTouch headers Mixxx was compiled with.
            << QString("SoundTouch: %1").arg(SOUNDTOUCH_VERSION)
            // The version of the TagLib headers Mixxx was compiled with.
            << QString("TagLib: %1.%2.%3").arg(QString::number(TAGLIB_MAJOR_VERSION),
                                               QString::number(TAGLIB_MINOR_VERSION),
                                               QString::number(TAGLIB_PATCH_VERSION))
            // The version of the ChromaPrint headers Mixxx was compiled with.
            << QString("ChromaPrint: %1.%2.%3").arg(QString::number(CHROMAPRINT_VERSION_MAJOR),
                                                    QString::number(CHROMAPRINT_VERSION_MINOR),
                                                    QString::number(CHROMAPRINT_VERSION_PATCH))
            // Should be accurate.
            << QString("Vorbis: %1").arg(vorbis_version_string())
            // Should be accurate.
            << QString("libsndfile: %1").arg(sndfile_version)
            // The version of the FLAC headers Mixxx was compiled with.
            << QString("FLAC: %1").arg(FLAC__VERSION_STRING)
            << QString("libmp3lame: %1").arg(get_lame_version());

    return result;
}
Exemple #6
0
int
ogg_vorbis_open (SF_PRIVATE *psf)
{	OGG_PRIVATE* odata = psf->container_data ;
	VORBIS_PRIVATE* vdata = calloc (1, sizeof (VORBIS_PRIVATE)) ;
	int	error = 0 ;

	if (odata == NULL)
	{	psf_log_printf (psf, "%s : odata is NULL???\n", __func__) ;
		return SFE_INTERNAL ;
	} ;

	psf->codec_data = vdata ;

	if (psf->file.mode == SFM_RDWR)
		return SFE_BAD_MODE_RW ;

	psf_log_printf (psf, "Vorbis library version : %s\n", vorbis_version_string ()) ;

	if (psf->file.mode == SFM_READ)
	{	/* Call this here so it only gets called once, so no memory is leaked. */
		ogg_sync_init (&odata->osync) ;

		if ((error = vorbis_read_header (psf, 1)))
			return error ;

		psf->read_short		= vorbis_read_s ;
		psf->read_int		= vorbis_read_i ;
		psf->read_float		= vorbis_read_f ;
		psf->read_double	= vorbis_read_d ;
		psf->sf.frames		= vorbis_length (psf) ;
	} ;

	psf->codec_close = vorbis_close ;
	if (psf->file.mode == SFM_WRITE)
	{	/* Set the default vorbis quality here. */
		vdata->quality = 0.4 ;

		psf->write_header	= vorbis_write_header ;
		psf->write_short	= vorbis_write_s ;
		psf->write_int		= vorbis_write_i ;
		psf->write_float	= vorbis_write_f ;
		psf->write_double	= vorbis_write_d ;

		psf->sf.frames = SF_COUNT_MAX ; /* Unknown really */
		psf->strings.flags = SF_STR_ALLOW_START ;
	} ;

	psf->seek = vorbis_seek ;
	psf->command = vorbis_command ;
	psf->byterate = vorbis_byterate ;

	/* FIXME, FIXME, FIXME : Hack these here for now and correct later. */
	psf->sf.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ;
	psf->sf.sections = 1 ;

	psf->datalength = 1 ;
	psf->dataoffset = 0 ;
	/* End FIXME. */

	return error ;
} /* ogg_vorbis_open */
Exemple #7
0
int
ogg_open (SF_PRIVATE *psf)
{	OGG_PRIVATE* odata = calloc (1, sizeof (OGG_PRIVATE)) ;
	VORBIS_PRIVATE* vdata = calloc (1, sizeof (VORBIS_PRIVATE)) ;
	int	error = 0 ;

	if (vdata == NULL || odata == NULL)
		return SFE_MALLOC_FAILED ;

	psf->container_data = odata ;
	psf->codec_data = vdata ;

	if (psf->file.mode == SFM_RDWR)
		return SFE_BAD_MODE_RW ;

#if HAVE_VORBIS_VERSION_STRING
	psf_log_printf (psf, "Vorbis library version : %s\n", vorbis_version_string ()) ;
#endif

	if (psf->file.mode == SFM_READ)
	{	/* Call this here so it only gets called once, so no memory is leaked. */
		ogg_sync_init (&odata->oy) ;

		if ((error = ogg_read_header (psf, 1)))
			return error ;

		psf->read_short		= ogg_read_s ;
		psf->read_int		= ogg_read_i ;
		psf->read_float		= ogg_read_f ;
		psf->read_double	= ogg_read_d ;
		psf->sf.frames		= ogg_length (psf) ;
		} ;

	psf->container_close = ogg_close ;
	if (psf->file.mode == SFM_WRITE)
	{
		/* Set the default vorbis quality here. */
		vdata->quality = 0.4 ;

		psf->write_header	= ogg_write_header ;
		psf->write_short	= ogg_write_s ;
		psf->write_int		= ogg_write_i ;
		psf->write_float	= ogg_write_f ;
		psf->write_double	= ogg_write_d ;

		psf->sf.frames = SF_COUNT_MAX ; /* Unknown really */
		psf->str_flags = SF_STR_ALLOW_START ;
		} ;

	psf->bytewidth = 1 ;
	psf->blockwidth = psf->bytewidth * psf->sf.channels ;

	psf->seek = ogg_seek ;
	psf->command = ogg_command ;

	/* FIXME, FIXME, FIXME : Hack these here for now and correct later. */
	psf->sf.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ;
	psf->sf.sections = 1 ;

	psf->datalength = 1 ;
	psf->dataoffset = 0 ;
	/* End FIXME. */

	return error ;
} /* ogg_open */
Exemple #8
0
krad_vorbis_t *krad_vorbis_encoder_create (int channels,
                                           int sample_rate,
                                           float quality) {

  int ret;
  int pos;
  krad_vorbis_t *vorbis;
  ogg_packet header_main;
  ogg_packet header_comments;
  ogg_packet header_codebooks;

  vorbis = calloc (1, sizeof(krad_vorbis_t));

  pos = 0;

  vorbis->error = 0;
  vorbis->state_str = "";

  vorbis->channels = channels;
  vorbis->sample_rate = sample_rate;
  vorbis->quality = quality;

  vorbis_info_init (&vorbis->vinfo);

  printk ("KR Vorbis Encoder Version: %s", vorbis_version_string());

  ret = vorbis_encode_init_vbr (&vorbis->vinfo,
                                vorbis->channels,
                                vorbis->sample_rate,
                                vorbis->quality);
  if (ret < 0) {
    vorbis->error = ret;
    vorbis->state_str = "Krad Vorbis Encoder: vorbis_encode_init_vbr fail";
    if (ret == OV_EIMPL) {
      vorbis->state_str = "Krad Vorbis Encoder: vorbis mode not supported";
    }
    if (ret == OV_EINVAL) {
      vorbis->state_str = "Krad Vorbis Encoder: illegal vorbis mode";
    }
    printke (vorbis->state_str);
    return vorbis;
  }

  vorbis->small_blocksz = vorbis_info_blocksize (&vorbis->vinfo, 0);
  vorbis->large_blocksz = vorbis_info_blocksize (&vorbis->vinfo, 1);

  printk ("KR Vorbis Encoder Setup: Channels %d Sample Rate: %d Quality: %f",
          vorbis->channels, vorbis->sample_rate, vorbis->quality);

  printk ("KR Vorbis Encoder Setup: Small Block Size: %u Large Block Size: %u",
          vorbis->small_blocksz, vorbis->large_blocksz);

  vorbis_analysis_init (&vorbis->vdsp, &vorbis->vinfo);
  vorbis_block_init (&vorbis->vdsp, &vorbis->vblock);
  vorbis_comment_init (&vorbis->vc);

#ifdef KR_VERSION_STR_FULL
  vorbis_comment_add_tag (&vorbis->vc, "ENCODER", KR_VERSION_STR_FULL);
#endif

  vorbis->header.codec = VORBIS;
  vorbis_analysis_headerout (&vorbis->vdsp,
                             &vorbis->vc,
                             &header_main,
                             &header_comments,
                             &header_codebooks);

  vorbis->hdrdata[0] = 0x02;
  vorbis->hdrdata[1] = (char)header_main.bytes;
  vorbis->hdrdata[2] = (char)header_comments.bytes;

  pos = 3;

  memcpy (vorbis->hdrdata + pos,
          header_main.packet,
          header_main.bytes);

  vorbis->header.data[0] = vorbis->hdrdata + pos;
  vorbis->header.sz[0] = header_main.bytes;
  pos += header_main.bytes;

  memcpy (vorbis->hdrdata + pos,
          header_comments.packet,
          header_comments.bytes);

  vorbis->header.data[1] = vorbis->hdrdata + pos;
  vorbis->header.sz[1] = header_comments.bytes;
  pos += header_comments.bytes;

  memcpy (vorbis->hdrdata + pos,
          header_codebooks.packet,
          header_codebooks.bytes);

  vorbis->header.data[2] = vorbis->hdrdata + pos;
  vorbis->header.sz[2] = header_codebooks.bytes;
  pos += header_codebooks.bytes;

  //vorbis->header.header_combined = vorbis->hdrdata;
  //vorbis->header.header_combined_size = pos;
  vorbis->header.count = 3;

  if (1) {
    printk ("KR Vorbis Encoder Setup: header test start");
    krad_vorbis_test_headers (&vorbis->header);
    printk ("KR Vorbis Encoder Setup: header test end");
  }

  vorbis->state_str = "Krad Vorbis Encoder: Init OK";

  return vorbis;
}