# HG changeset patch
# User hgs
# Date 1269471857 18000
# Node ID 8e837d1bf44677397a3dd174003a8806987706a1
# Parent 4b0c6ed4323445c21e5126bc294425a1ca678d37
201009
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/QtGSTPlayer.loc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/QtGSTPlayer.loc Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,13 @@
+// ============================================================================
+// * Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-02-23T15:57:15
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// ============================================================================
+
+#ifdef LANGUAGE_SC
+#define STRING_r_short_caption "QtGSTPlayer"
+#define STRING_r_caption "QtGSTPlayer"
+#else
+#define STRING_r_short_caption "QtGSTPlayer"
+#define STRING_r_caption "QtGSTPlayer"
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/QtGSTPlayer.pro
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/QtGSTPlayer.pro Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,33 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Wed Feb 17 14:34:47 2010
+######################################################################
+
+
+# ============================================================================
+# Name : QtGSTPlayer.pro
+# Part of : LibHb / gstplayer
+# Description : Project definition file for simple gstplayer
+# Version : %version: 1 %
+#
+# Copyright ? 2008 Nokia. All rights reserved.
+# This material, including documentation and any related computer
+# programs, is protected by copyright controlled by Nokia. All
+# rights are reserved. Copying, including reproducing, storing,
+# adapting or translating, any or all of this material requires the
+# prior written consent of Nokia. This material also contains
+# confidential information which may not be disclosed to others
+# without the prior written consent of Nokia.
+# ============================================================================
+#
+
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+SOURCES += main.cpp folderview.cpp views.cpp record_play.c
+HEADERS += folderview.h views.h
+
+RESOURCES += QtGSTPlayer.qrc
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/QtGSTPlayer.qrc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/QtGSTPlayer.qrc Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,6 @@
+
+
+ folder.png
+ settings.png
+
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/QtGSTPlayer.rss
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/QtGSTPlayer.rss Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,21 @@
+// ============================================================================
+// * Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-02-23T15:57:15
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// ============================================================================
+
+#include
+#include "QtGSTPlayer.loc"
+
+RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
+ {
+ short_caption = STRING_r_short_caption;
+ caption_and_icon =
+ CAPTION_AND_ICON_INFO
+ {
+ caption = STRING_r_caption;
+ number_of_icons = 0;
+ icon_file = "";
+ };
+ }
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/QtGSTPlayer_0x2002c392.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/QtGSTPlayer_0x2002c392.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,142 @@
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-02-23T15:57:15
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : QtGSTPlayer.mmp
+// ==============================================================================
+
+TARGET QtGSTPlayer.exe
+TARGETTYPE EXE
+
+UID 0x2002c391 0x2002c392
+SECUREID 0x2002c392
+
+CAPABILITY All -Tcb
+EPOCSTACKSIZE 0x14000
+EPOCHEAPSIZE 0x020000 0x800000
+
+SOURCEPATH .
+LANG SC
+START RESOURCE QtGSTPlayer.rss
+HEADER
+TARGETPATH /resource/apps
+END
+
+SOURCEPATH .
+START RESOURCE QtGSTPlayer_reg.rss
+TARGETPATH /private/10003a3f/import/apps
+END
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO HB_GESTURE_FW
+MACRO HB_EFFECTS
+MACRO QT_NO_DEBUG
+MACRO QT_GUI_LIB
+MACRO QT_CORE_LIB
+SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore
+SYSTEMINCLUDE /epoc32/include/mw/hb/hbfeedback
+SYSTEMINCLUDE /epoc32/include/mw/hb/hbinput
+SYSTEMINCLUDE /epoc32/include/mw/hb/hbtools
+SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets
+
+
+SYSTEMINCLUDE /epoc32/include/mw/QtCore
+SYSTEMINCLUDE /epoc32/include/mw/QtGui
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE ../../../qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../../../qt/mkspecs/common/symbian/tmp
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/stdapis
+SYSTEMINCLUDE /epoc32/include/stdapis/sys
+SYSTEMINCLUDE .
+SYSTEMINCLUDE tmp
+
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE /epoc32/include/platform/mw
+SYSTEMINCLUDE /epoc32/include/platform
+SYSTEMINCLUDE /epoc32/include/platform/loc
+SYSTEMINCLUDE /epoc32/include/platform/mw/loc
+SYSTEMINCLUDE /epoc32/include/platform/loc/sc
+SYSTEMINCLUDE /epoc32/include/platform/mw/loc/sc
+SYSTEMINCLUDE /epoc32/include/mw/qtgui
+SYSTEMINCLUDE /epoc32/include/mw/qtcore
+MW_LAYER_SYSTEMINCLUDE
+OS_LAYER_LIBC_SYSTEMINCLUDE
+
+OS_LAYER_GLIB_SYSTEMINCLUDE
+
+USERINCLUDE /sf/mw/gstreamer/include/gstreamer
+USERINCLUDE /sf/mw/gstreamer/include/gstreamer/gst
+USERINCLUDE /sf/mw/gstreamer/include/gstreamer/gst/base
+USERINCLUDE /sf/mw/gstreamer/include/gstreamer/gst/controller
+USERINCLUDE /sf/mw/gstreamer/include/gstreamer/gst/dataprotocol
+USERINCLUDE /sf/mw/gstreamer/include/gstreamer/gst/net
+
+
+
+SOURCEPATH .
+SOURCE main.cpp
+SOURCE folderview.cpp
+SOURCE views.cpp
+SOURCE record_play.c
+SOURCE moc_folderview.cpp
+SOURCE qrc_QtGSTPlayer.cpp
+
+
+LIBRARY HbCore.lib
+LIBRARY HbWidgets.lib
+LIBRARY HbTools.lib
+LIBRARY QtGui.lib
+LIBRARY QtCore.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+LIBRARY apgrfx.lib
+LIBRARY libglib.lib
+LIBRARY libgmodule.lib
+
+LIBRARY libgobject.lib
+LIBRARY libgthread.lib
+
+
+LIBRARY libgstreamer.lib
+LIBRARY libgstbase.lib
+LIBRARY libgstcontroller.lib
+
+
+STATICLIBRARY qtmain.lib
+
+
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+
+VERSION 10.0
+
+PAGED
+
+OPTION_REPLACE ARMCC --export_all_vtbl -D__QT_NOEFFECTMACRO_DONOTUSE
+
+USERINCLUDE .
+
+STDCPP
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/QtGSTPlayer_reg.rss
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/QtGSTPlayer_reg.rss Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,18 @@
+// ============================================================================
+// * Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-02-23T15:57:15
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// ============================================================================
+
+#include
+#include
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x2002c392
+
+RESOURCE APP_REGISTRATION_INFO
+ {
+ app_file="QtGSTPlayer";
+ localisable_resource_file="\\resource\\apps\\QtGSTPlayer";
+
+ }
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/QtGSTPlayer_template.pkg
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/QtGSTPlayer_template.pkg Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,32 @@
+; QtGSTPlayer_template.pkg generated by qmake at 2010-02-23T15:57:15
+; This file is generated by qmake and should not be modified by the user
+;
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"QtGSTPlayer"},(0x2002c392),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+; Manual PKG pre-rules from PRO files
+; Default HW/platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+
+; Default dependency to Qt libraries
+;(0x2001E61C), , , , {"Qt"}
+
+; Executable and default resource files
+"/epoc32/release/armv5/urel/QtGSTPlayer.exe" - "!:\sys\bin\QtGSTPlayer.exe"
+"/epoc32/data/z/resource/apps/QtGSTPlayer.rsc" - "!:\resource\apps\QtGSTPlayer.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/QtGSTPlayer_reg.rsc" - "!:\private\10003a3f\import\apps\QtGSTPlayer_reg.rsc"
+
+; Manual PKG post-rules from PRO files
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/bld.inf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/bld.inf Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,21 @@
+// ============================================================================
+// * Makefile for building: QtGSTPlayer
+// * Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-02-23T15:57:15
+// * This file is generated by qmake and should not be modified by the
+// * user.
+// * Project: QtGSTPlayer.pro
+// * Template: app
+// ============================================================================
+
+#define BLD_INF_QTGSTPLAYER_024F332B
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_MMPFILES
+QtGSTPlayer_0x2002c392.mmp
+
+prj_extensions
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/folder.png
Binary file QtGSTPlayer/folder.png has changed
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/folderview.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/folderview.cpp Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,357 @@
+#include
+#include
+#include
+
+//#include
+//#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include "folderview.h"
+#include "views.h"
+#include
+#include
+#include
+/*! Constructor of FolderView.
+ */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+int mCurrentState = 0;
+
+#ifdef __cplusplus
+}
+#endif
+//extern int mCurrentState;
+
+FolderView::FolderView(QGraphicsItem *parent)
+ : HbView(parent),mModel( NULL ), mFolderPath("c:\\data\\Sounds\\Digital\\"),mTimer(NULL),mIsRecording( FALSE )
+{
+ mCurrentState = NONE;
+
+ // Create a main widget for this view
+ // In this case, list view is appropriate
+ // Note: HbListView is not derived from HbView,
+ // this is just like any other Hb widget but with a feature of
+ // model-view separation
+ mFileList = new HbListView(this);
+
+ // Create a model to set for the list view
+ mModel = new QDirModel(this);
+ mFileList->setModel(mModel);
+
+ // Setting initial path for folder list
+ mFileList->setRootIndex(mModel->index(mFolderPath));
+ //mFileList->
+ // Setting the main widget for this view
+ setWidget(mFileList);
+ //int x = mFileList->indexCount();
+ QObject::connect(mFileList, SIGNAL(pressed(const QModelIndex)), this, SLOT(item_pressed(const QModelIndex)));
+
+ // add menu
+ HbMenu* menu1 = menu()->addMenu(tr("Record"));
+
+ HbAction* menu1_Action = new HbAction(tr("RAW"), this);
+ connect(menu1_Action, SIGNAL(triggered()), this, SLOT(record_RAW()));
+ menu1->addAction( menu1_Action );
+
+ menu1_Action = new HbAction(tr("WAV"), this);
+ connect(menu1_Action, SIGNAL(triggered()), this, SLOT(record_WAV()));
+ menu1->addAction( menu1_Action );
+
+ //create action Nokia India sub menu item.
+ menu1_Action = new HbAction(tr("AMR"), this);
+ connect(menu1_Action, SIGNAL(triggered()), this, SLOT(record_AMR()));
+ menu1->addAction( menu1_Action );
+
+ menu1_Action = new HbAction(tr("G711"), this);
+ connect(menu1_Action, SIGNAL(triggered()), this, SLOT(record_G711()));
+ menu1->addAction( menu1_Action );
+
+ menu1_Action = new HbAction(tr("AAC"), this);
+ connect(menu1_Action, SIGNAL(triggered()), this, SLOT(record_AAC()));
+ menu1->addAction( menu1_Action );
+ menu1_Action = new HbAction(tr("G729"), this);
+ connect(menu1_Action, SIGNAL(triggered()), this, SLOT(record_G729()));
+ menu1->addAction( menu1_Action );
+
+ menu1_Action = new HbAction(tr("ILBC"), this);
+ connect(menu1_Action, SIGNAL(triggered()), this, SLOT(record_ILBC()));
+ menu1->addAction( menu1_Action );
+
+
+
+ //menu()->addAction(tr("Play"), this, SLOT(play()));
+ menu()->addAction(tr("Stop"), this, SLOT(stop()));
+ menu()->addAction(tr("Pause"), this, SLOT(pause()));
+ menu()->addAction(tr("Resume"), this, SLOT(resume()));
+ menu()->addAction(tr("Exit"), qApp, SLOT(quit()));
+
+
+ /// timer required to get the glib events
+ mTimer = new QTimer(this);
+ connect(mTimer, SIGNAL(timeout()), this, SLOT(timertimeout()));
+ mTimer->start(10);
+
+}
+
+FolderView::~FolderView()
+{
+ if(mCurrentState != NONE)
+ gst_unref();
+delete mFileList;
+delete mModel;
+mTimer->stop();
+delete mTimer;
+}
+
+
+void FolderView::folderViewTriggered()
+{
+ mainWindow()->setCurrentView(Views::folderView());
+}
+
+/*void FolderView::settingsViewTriggered()
+{
+ mainWindow()->setCurrentView(Views::settingsView());
+}*/
+
+void FolderView::showNote(const int err)
+{
+ if(err)
+ {
+ HbNotificationDialog* notifyDialog = new HbNotificationDialog;
+ notifyDialog->setTimeout(HbPopup::StandardTimeout);
+ QString strong;
+ QString sprint= strong.sprintf("Format Not supported(%d)",err);
+ notifyDialog->setTitleTextWrapping(Hb::TextWordWrap);
+ notifyDialog->setTitle(QString("Error"));
+ notifyDialog->setWrapMode(Hb::TextWordWrap);
+ notifyDialog->setText(sprint);
+
+ notifyDialog->exec();
+ delete notifyDialog;
+ }
+}
+void FolderView::item_pressed(const QModelIndex &index)
+{
+ if( mIsRecording )
+ {
+ return;
+ }
+ QVariant variant=index.data();
+ QString str = variant.toString();
+
+
+ QString fullpath = mFolderPath;
+ fullpath.append( str );
+
+ TBuf16<1024> buf16;
+ buf16.Copy( (TUint16*)fullpath.data_ptr()->data ,fullpath.data_ptr()->size );
+ TBuf8<1024> buf8;
+ buf8.Copy( buf16 );
+
+ if( NONE != mCurrentState )
+ {
+ gst_unref();
+ }
+
+ int err = gst_play_file( (char*)buf8.PtrZ() );
+ if(err)
+ {
+ showNote(err);
+ mCurrentState = NONE;
+ }
+ else
+ {
+ mCurrentState = PLAYING;
+ }
+
+}
+void FolderView::pause()
+{
+ if( PLAYING == mCurrentState ){
+ gst_pause();
+ mCurrentState = PAUSE;
+ }
+}
+
+void FolderView::resume()
+{
+ if( PAUSE == mCurrentState ){
+ gst_resume();
+ mCurrentState = PLAYING;
+ }
+}
+
+void FolderView::stop()
+{
+ if( mIsRecording == TRUE )
+ {
+ gst_record_stop();
+
+ if( mModel )
+ delete mModel;
+
+ mModel = new QDirModel(this);
+ mFileList->setModel(mModel);
+
+ mFileList->reset();
+ mFileList->setRootIndex(mModel->index(mFolderPath));
+// mFileList->show();
+// int x = mFileList->indexCount();
+ //setWidget(mFileList);
+ mIsRecording = FALSE;
+ return;
+ }
+ if( PLAYING == mCurrentState || PAUSE == mCurrentState ){
+ gst_unref();
+ mCurrentState = NONE;
+ }
+}
+
+void FolderView::record_AMR()
+{
+ if( mCurrentState == NONE ){
+ int err = gst_record_file( RECORD_AMR );
+ if(err)
+ {
+ showNote(err);
+ mCurrentState = NONE;
+ mIsRecording = FALSE;
+ }
+ else
+ {
+ mCurrentState = PLAYING;
+ mIsRecording = TRUE;
+ }
+ }
+}
+
+void FolderView::record_WAV()
+{
+ if( mCurrentState == NONE ){
+ int err = gst_record_file( RECORD_WAV );
+ if(err)
+ {
+ showNote(err);
+ mCurrentState = NONE;
+ mIsRecording = FALSE;
+ }
+ else
+ {
+ mCurrentState = PLAYING;
+ mIsRecording = TRUE;
+ }
+ //gst_record_wav();
+ }
+}
+
+void FolderView::record_RAW()
+{
+ if( mCurrentState == NONE ){
+ int err = gst_record_file( RECORD_RAW );
+ if(err)
+ {
+ showNote(err);
+ mCurrentState = NONE;
+ mIsRecording = FALSE;
+ }
+ else
+ {
+ mCurrentState = PLAYING;
+ mIsRecording = TRUE;
+ }
+ }
+}
+
+void FolderView::record_G711()
+{
+ if( mCurrentState == NONE ){
+ int err = gst_record_file( RECORD_G711 );
+ if(err)
+ {
+ showNote(err);
+ mCurrentState = NONE;
+ mIsRecording = FALSE;
+ }
+ else
+ {
+ mCurrentState = PLAYING;
+ mIsRecording = TRUE;
+ }
+ }
+}
+
+void FolderView::record_G729()
+{
+ if( mCurrentState == NONE ){
+ int err = gst_record_file( RECORD_G729 );
+ if(err)
+ {
+ showNote(err);
+ mCurrentState = NONE;
+ mIsRecording = FALSE;
+ }
+ else
+ {
+ mCurrentState = PLAYING;
+ mIsRecording = TRUE;
+ }
+ }
+}
+
+void FolderView::record_ILBC()
+{
+ if( mCurrentState == NONE ){
+ int err = gst_record_file( RECORD_ILBC );
+ if(err)
+ {
+ showNote(err);
+ mCurrentState = NONE;
+ mIsRecording = FALSE;
+ }
+ else
+ {
+ mCurrentState = PLAYING;
+ mIsRecording = TRUE;
+ }
+ }
+}
+
+void FolderView::record_AAC()
+{
+ if( mCurrentState == NONE ){
+ int err = gst_record_file( RECORD_AAC );
+ if(err)
+ {
+ showNote(err);
+ mCurrentState = NONE;
+ mIsRecording = FALSE;
+ }
+ else
+ {
+ mCurrentState = PLAYING;
+ mIsRecording = TRUE;
+ }
+ }
+}
+void FolderView::timertimeout()
+{
+ if( PLAYING == mCurrentState ){
+ gst_get_events();
+ }
+
+ if( STOP == mCurrentState ){
+ gst_unref();
+ mCurrentState = NONE;
+ mIsRecording = FALSE;
+ }
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/folderview.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/folderview.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,64 @@
+#ifndef FOLDERVIEW_H
+#define FOLDERVIEW_H
+
+#include
+//#include
+
+#include "record_play.h"
+
+QT_BEGIN_NAMESPACE
+class QDirModel;
+QT_END_NAMESPACE
+
+//class HbFormItem;
+class HbListView;
+
+class FolderView : public HbView
+{
+ Q_OBJECT
+
+public:
+ explicit FolderView(QGraphicsItem *parent = 0);
+ ~FolderView();
+public slots:
+ void folderViewTriggered();
+ //void settingsViewTriggered();
+ void item_pressed(const QModelIndex &index);
+//
+ void record_AMR();
+ void record_WAV();
+ void record_RAW();
+ void record_G711();
+ void record_G729();
+ void record_ILBC();
+ void record_AAC();
+
+ void pause();
+ void resume();
+ void stop();
+ void timertimeout();
+ void showNote(const int err);
+
+//void record_file( int type );
+
+
+private:
+ HbListView *mFileList;
+
+//signals:
+// void pressed(const QModelIndex &index);
+// void released(const QModelIndex &index);
+// void activated(const QModelIndex &index);
+// void longPressed(HbAbstractViewItem *item, const QPointF &coords);
+
+ QDirModel *mModel;
+ QString mFolderPath;
+ QTimer *mTimer;
+ bool mIsRecording;
+
+
+ //state st;
+
+};
+
+#endif // FOLDERVIEW_H
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/main.cpp Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,52 @@
+/*! This is an example application demonstrating how a simple Hb
+ application is created. This application implements a folder
+ browser. The application creates two views. The main view (Folder
+ view) shows the folder contents. The second view (Settings view) can
+ be used to set the path which is shown in the Folder view. Settings
+ view uses the HbFormView. Folder view inherits HbView and implements
+ a couple of methods to populate the Folder view. */
+
+#include
+#include
+#include
+#include
+#include
+
+
+#include
+#include
+#include
+
+#include "folderview.h"
+#include "views.h"
+
+int main(int argc, char *argv[])
+{
+ // Create HbApplication
+ gst_init (&argc, &argv);
+ HbApplication a(argc, argv);
+ a.setApplicationName(QObject::tr("Folder Browser"));
+ //LOG(_L("Entering main.cpp"));
+
+ // Create main window
+ HbMainWindow mainWindow;
+
+ // Create View#1 : Folder view
+ HbView *folderView = new FolderView;
+ // Title pane text
+ folderView->setTitle(QObject::tr("QtGSTPlayer"));
+
+ // Add two views to main window,
+ // the adding order determines which one is shown first
+
+ mainWindow.addView(folderView);
+ /*mainWindow.addView(settingsView);*/
+
+ // Store the mainwindow ptr.
+ Views::win = &mainWindow;
+
+ // Show main window
+ mainWindow.show();
+
+ return a.exec();
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/moc_folderview.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/moc_folderview.cpp Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,110 @@
+/****************************************************************************
+** Meta object code from reading C++ file 'folderview.h'
+**
+** Created: Tue Feb 23 15:59:43 2010
+** by: The Qt Meta Object Compiler version 62 (Qt 4.6.1)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include "folderview.h"
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#error "The header file 'folderview.h' doesn't include ."
+#elif Q_MOC_OUTPUT_REVISION != 62
+#error "This file was generated using the moc from 4.6.2. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+QT_BEGIN_MOC_NAMESPACE
+static const uint qt_meta_data_FolderView[] = {
+
+ // content:
+ 4, // revision
+ 0, // classname
+ 0, 0, // classinfo
+ 14, 14, // methods
+ 0, 0, // properties
+ 0, 0, // enums/sets
+ 0, 0, // constructors
+ 0, // flags
+ 0, // signalCount
+
+ // slots: signature, parameters, type, tag, flags
+ 12, 11, 11, 11, 0x0a,
+ 40, 34, 11, 11, 0x0a,
+ 66, 11, 11, 11, 0x0a,
+ 79, 11, 11, 11, 0x0a,
+ 92, 11, 11, 11, 0x0a,
+ 105, 11, 11, 11, 0x0a,
+ 119, 11, 11, 11, 0x0a,
+ 133, 11, 11, 11, 0x0a,
+ 147, 11, 11, 11, 0x0a,
+ 160, 11, 11, 11, 0x0a,
+ 168, 11, 11, 11, 0x0a,
+ 177, 11, 11, 11, 0x0a,
+ 184, 11, 11, 11, 0x0a,
+ 203, 199, 11, 11, 0x0a,
+
+ 0 // eod
+};
+
+static const char qt_meta_stringdata_FolderView[] = {
+ "FolderView\0\0folderViewTriggered()\0"
+ "index\0item_pressed(QModelIndex)\0"
+ "record_AMR()\0record_WAV()\0record_RAW()\0"
+ "record_G711()\0record_G729()\0record_ILBC()\0"
+ "record_AAC()\0pause()\0resume()\0stop()\0"
+ "timertimeout()\0err\0showNote(int)\0"
+};
+
+const QMetaObject FolderView::staticMetaObject = {
+ { &HbView::staticMetaObject, qt_meta_stringdata_FolderView,
+ qt_meta_data_FolderView, 0 }
+};
+
+#ifdef Q_NO_DATA_RELOCATION
+const QMetaObject &FolderView::getStaticMetaObject() { return staticMetaObject; }
+#endif //Q_NO_DATA_RELOCATION
+
+const QMetaObject *FolderView::metaObject() const
+{
+ return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
+}
+
+void *FolderView::qt_metacast(const char *_clname)
+{
+ if (!_clname) return 0;
+ if (!strcmp(_clname, qt_meta_stringdata_FolderView))
+ return static_cast(const_cast< FolderView*>(this));
+ return HbView::qt_metacast(_clname);
+}
+
+int FolderView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+ _id = HbView::qt_metacall(_c, _id, _a);
+ if (_id < 0)
+ return _id;
+ if (_c == QMetaObject::InvokeMetaMethod) {
+ switch (_id) {
+ case 0: folderViewTriggered(); break;
+ case 1: item_pressed((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
+ case 2: record_AMR(); break;
+ case 3: record_WAV(); break;
+ case 4: record_RAW(); break;
+ case 5: record_G711(); break;
+ case 6: record_G729(); break;
+ case 7: record_ILBC(); break;
+ case 8: record_AAC(); break;
+ case 9: pause(); break;
+ case 10: resume(); break;
+ case 11: stop(); break;
+ case 12: timertimeout(); break;
+ case 13: showNote((*reinterpret_cast< const int(*)>(_a[1]))); break;
+ default: ;
+ }
+ _id -= 14;
+ }
+ return _id;
+}
+QT_END_MOC_NAMESPACE
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/qrc_QtGSTPlayer.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/qrc_QtGSTPlayer.cpp Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,1116 @@
+/****************************************************************************
+** Resource object code
+**
+** Created: Tue Feb 23 15:59:43 2010
+** by: The Resource Compiler for Qt version 4.6.1
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include
+
+static const unsigned char qt_resource_data[] = {
+ // Q:/sf/mw/gstreamer/internal/QtGSTPlayer/folder.png
+ 0x0,0x0,0x20,0xb2,
+ 0x89,
+ 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
+ 0x0,0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0x0,0x0,0x49,0x45,0x4e,
+ 0x44,0xae,0x42,0x60,0x82,
+
+};
+
+static const unsigned char qt_resource_name[] = {
+ // QtGSTPlayer
+ 0x0,0xb,
+ 0x9,0xc3,0x96,0xc2,
+ 0x0,0x51,
+ 0x0,0x74,0x0,0x47,0x0,0x53,0x0,0x54,0x0,0x50,0x0,0x6c,0x0,0x61,0x0,0x79,0x0,0x65,0x0,0x72,
+ // folder.png
+ 0x0,0xa,
+ 0xa,0xc8,0xfb,0x7,
+ 0x0,0x66,
+ 0x0,0x6f,0x0,0x6c,0x0,0x64,0x0,0x65,0x0,0x72,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
+ // settings.png
+ 0x0,0xc,
+ 0xb,0xdf,0x21,0x47,
+ 0x0,0x73,
+ 0x0,0x65,0x0,0x74,0x0,0x74,0x0,0x69,0x0,0x6e,0x0,0x67,0x0,0x73,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
+
+};
+
+static const unsigned char qt_resource_struct[] = {
+ // :
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
+ // :/QtGSTPlayer
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x2,
+ // :/QtGSTPlayer/folder.png
+ 0x0,0x0,0x0,0x1c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+ // :/QtGSTPlayer/settings.png
+ 0x0,0x0,0x0,0x36,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x20,0xb6,
+
+};
+
+QT_BEGIN_NAMESPACE
+
+extern Q_CORE_EXPORT bool qRegisterResourceData
+ (int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+extern Q_CORE_EXPORT bool qUnregisterResourceData
+ (int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+QT_END_NAMESPACE
+
+
+int QT_MANGLE_NAMESPACE(qInitResources_QtGSTPlayer)()
+{
+ QT_PREPEND_NAMESPACE(qRegisterResourceData)
+ (0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
+ return 1;
+}
+
+Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_QtGSTPlayer))
+
+int QT_MANGLE_NAMESPACE(qCleanupResources_QtGSTPlayer)()
+{
+ QT_PREPEND_NAMESPACE(qUnregisterResourceData)
+ (0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
+ return 1;
+}
+
+Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources_QtGSTPlayer))
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/record_play.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/record_play.c Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,855 @@
+
+
+#include
+#include
+#include
+#include "record_play.h"
+
+
+GstElement *bin;
+extern int mCurrentState;
+
+static GstElement *
+create_video_output ()
+{
+ static gboolean have_video = FALSE;
+ GstBin *bin;
+ GstElement *queue, *sink;
+ GstPad *pad;
+
+ if (have_video) {
+ //g_print ("Already playing a video stream. Ignoring this one\n");
+ return NULL;
+ }
+
+ /* create a new bin to hold the elements */
+ if((bin = (GstBin*) gst_bin_new (NULL)) == NULL)
+ //bin = (GstBin*) gst_pipeline_new("pipeline");
+ return NULL;
+
+ /* Queue to ensure all streams can push data */
+ queue = gst_element_factory_make ("queue", "q");
+ if(queue == NULL)
+ return NULL;/* Queue should always be available */
+ /* Set the queue to buffer 1/10 of a second of raw video */
+ g_object_set (queue, "max-size-time", (GstClockTime) GST_SECOND / 10,
+ "max-size-bytes", 0, "max-size-buffers", 0, NULL);
+
+// cs = gst_element_factory_make ("ffmpegcolorspace", "cs");
+// if (!cs)
+// goto no_output;
+
+ /* and a video sink */
+ sink = gst_element_factory_make ("fakesink"/*autovideosink*/, "sink");
+ if (!sink)
+ goto no_output;
+
+ /* add objects to the main pipeline */
+ gst_bin_add_many (GST_BIN (bin), queue, sink, NULL);
+
+ /* Link the elements */
+ gst_element_link_many (queue, sink, NULL);
+
+ /* Retrieve the sinkpad from the queue and 'ghost' it onto
+ * the bin so that the caller can find it generically */
+ pad = gst_element_get_pad (queue, "sink");
+ gst_element_add_pad (GST_ELEMENT (bin), gst_ghost_pad_new ("sink", pad));
+ gst_object_unref (pad);
+
+ //have_video = TRUE;
+
+ return GST_ELEMENT (bin);
+
+ /* ERRORS */
+no_output:
+ {
+ //g_print ("Could not create either ffmpegcolorspace or autovideosink for output");
+ return NULL;
+ }
+}
+
+static GstElement *
+create_audio_output ()
+{
+ static gboolean have_audio = FALSE;
+ GstBin *bin;
+ GstElement *queue, *audioconvert,*audioresample, *sink;
+ GstPad *pad;
+
+ if (have_audio) {
+ //g_print ("Already playing an audio stream. Ignoring this one\n");
+ return NULL;
+ }
+
+ /* create a new bin to hold the elements */
+ bin = (GstBin*) gst_bin_new (NULL);
+ if(!bin)
+ goto no_output;
+
+ /* Queue to ensure all streams can push data */
+ queue = gst_element_factory_make ("queue", "q");
+ if (!queue) /* Queue should always be available */
+ goto no_output;
+ /* Set the queue to buffer 1/10 of a second of raw audio */
+ g_object_set (queue, "max-size-time", (GstClockTime) GST_SECOND / 10,
+ "max-size-bytes", 0, "max-size-buffers", 0, NULL);
+
+ /* an audio converter to convert floating-point audio samples to int format */
+ audioconvert = gst_element_factory_make ("audioconvert", "ac");
+ if (!audioconvert)
+ goto no_output;
+
+ /* an audio converter to convert floating-point audio samples to int format */
+ audioresample = gst_element_factory_make ("audioresample", "audioresample");
+ if (!audioresample)
+ goto no_output;
+
+ /* and an audio sink */
+ sink = gst_element_factory_make ("autoaudiosink", "sink");
+ if (!sink)
+ goto no_output;
+
+ /* add objects to the bin */
+ gst_bin_add_many (GST_BIN (bin), queue, audioconvert,audioresample, sink, NULL);
+
+ /* link the elements */
+ gst_element_link_many (queue, audioconvert,audioresample, sink, NULL);
+
+ /* Retrieve the sinkpad from the queue element and 'ghost' it onto
+ * the bin so that the caller can find it generically */
+ pad = gst_element_get_pad (queue, "sink");
+ gst_element_add_pad (GST_ELEMENT (bin), gst_ghost_pad_new ("sink", pad));
+ gst_object_unref (pad);
+
+ //have_audio = TRUE;
+
+ return GST_ELEMENT (bin);
+
+ /* ERRORS */
+no_output:
+ {
+ //g_print ("Could not create either ffmpegcolorspace or autovideosink for output");
+ return NULL;
+ }
+}
+
+static void
+new_decoded_pad (GstElement * element, GstPad * pad, gboolean last,
+ GstBin *top_pipeline)
+{
+ GstPad *out_pad;
+ GstElement *output = NULL;
+ GstCaps *caps;
+ GstStructure *s;
+ const gchar *stream_type;
+
+ /* Decide which output we are creating based on the stream contents */
+ caps = gst_pad_get_caps (pad);
+ if (caps == NULL) {
+ //g_print ("Decodebin produced an unknown stream - ignoring\n");
+ return;
+ }
+
+ s = gst_caps_get_structure (caps, 0);
+ if(s == NULL)/* Caps on a pad should always have exactly one entry */
+ return;
+
+ stream_type = gst_structure_get_name (s);
+
+ if (g_str_has_prefix (stream_type, "video/x-raw-")) {
+ /* Is a new video stream */
+ //g_print ("Encountered a new video stream\n");
+ output = create_video_output ();
+ }
+ else if (g_str_has_prefix (stream_type, "audio/x-raw-")) {
+ //g_print ("Encountered a new audio stream\n");
+ output = create_audio_output ();
+ }
+ else {
+ //g_print ("Found unknown stream of type %s - ignoring\n", stream_type);
+ }
+
+ /* If no renderer was created, ignore this stream */
+ if (output == NULL)
+ return;
+
+ /* Add the output into our pipeline */
+ gst_bin_add (top_pipeline, output);
+
+ /* If we created a output pipeline, retrieve the sink pad from it */
+ out_pad = gst_element_get_pad (output, "sink");
+ g_return_if_fail (out_pad != NULL);
+
+ /* Attempt to link the new pad to the output */
+ if (gst_pad_link (pad, out_pad) != GST_PAD_LINK_OK) {
+ //g_print ("Failed to add the rendering pipeline for this new data stream\n");
+ gst_bin_remove (top_pipeline, output);
+ gst_object_unref (out_pad);
+ return;
+ }
+ gst_object_unref (out_pad);
+
+ /* New output renderer is successfully linked in the pipeline.
+ * Change its state to playing so it is ready to receive data */
+ gst_element_set_state (output, GST_STATE_PLAYING);
+}
+
+static void
+print_tag (const GstTagList * list, const gchar * tag, gpointer unused)
+{
+ gint i, count;
+
+ count = gst_tag_list_get_tag_size (list, tag);
+
+ for (i = 0; i < count; i++) {
+ gchar *str;
+
+ if (gst_tag_get_type (tag) == G_TYPE_STRING) {
+ if (!gst_tag_list_get_string_index (list, tag, i, &str))
+ g_assert_not_reached ();
+ } else {
+ str =
+ g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i));
+ }
+
+ if (i == 0) {
+ //g_print (" %15s: %s\n", gst_tag_get_nick (tag), str);
+ } else {
+ //g_print (" : %s\n", str);
+ }
+
+ g_free (str);
+ }
+}
+
+
+
+static gboolean
+bus_call (GstBus *bus,
+ GstMessage *message,
+ gpointer data)
+{
+ switch (GST_MESSAGE_TYPE (message)){
+ case GST_MESSAGE_EOS:
+ gst_message_unref (message);
+ gst_element_set_state (bin, GST_STATE_NULL);
+ /* Unreffing the bin will clean up all its children too */
+ gst_object_unref (bin);
+ mCurrentState = NONE;
+ break;
+ case GST_MESSAGE_ERROR:{
+ GError *gerror;
+ gchar *debug;
+
+ gst_message_parse_error (message, &gerror, &debug);
+ gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
+ gst_message_unref (message);
+ g_error_free (gerror);
+ g_free (debug);
+ gst_element_set_state (bin, GST_STATE_NULL);
+ /* Unreffing the bin will clean up all its children too */
+ gst_object_unref (bin);
+ mCurrentState = NONE;
+ break;
+ }
+ case GST_MESSAGE_WARNING:{
+ GError *gerror;
+ gchar *debug;
+
+ gst_message_parse_warning (message, &gerror, &debug);
+ gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
+ gst_message_unref (message);
+ g_error_free (gerror);
+ g_free (debug);
+ break;
+ }
+ case GST_MESSAGE_TAG:
+ {
+ GstTagList *tags;
+
+ gst_message_parse_tag (message, &tags);
+ if (tags) {
+ //g_print ("TAGS received from element \"%s\".\n",
+ // GST_STR_NULL (GST_ELEMENT_NAME (GST_MESSAGE_SRC (message))));
+
+ gst_tag_list_foreach (tags, print_tag, NULL);
+ gst_tag_list_free (tags);
+ tags = NULL;
+ }
+ break;
+ }
+ default:
+ gst_message_unref (message);
+ break;
+ }
+ return TRUE;
+}
+
+
+
+//static void
+//event_loop (GstElement * pipe)
+//{
+// GstBus *bus;
+// GstMessage *message = NULL;
+//
+// bus = gst_element_get_bus (GST_ELEMENT (pipe));
+//
+// while (TRUE) {
+// message = gst_bus_poll (bus, GST_MESSAGE_ANY, -1);
+//
+// g_assert (message != NULL);
+//
+// switch (message->type) {
+// case GST_MESSAGE_EOS:
+// gst_message_unref (message);
+// return;
+// case GST_MESSAGE_ERROR:{
+// GError *gerror;
+// gchar *debug;
+//
+// gst_message_parse_error (message, &gerror, &debug);
+// gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
+// gst_message_unref (message);
+// g_error_free (gerror);
+// g_free (debug);
+// return;
+// }
+// case GST_MESSAGE_WARNING:{
+// GError *gerror;
+// gchar *debug;
+//
+// gst_message_parse_warning (message, &gerror, &debug);
+// gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
+// gst_message_unref (message);
+// g_error_free (gerror);
+// g_free (debug);
+// break;
+// }
+// case GST_MESSAGE_TAG:
+// {
+// GstTagList *tags;
+//
+// gst_message_parse_tag (message, &tags);
+// if (tags) {
+// //g_print ("TAGS received from element \"%s\".\n",
+// GST_STR_NULL (GST_ELEMENT_NAME (GST_MESSAGE_SRC (message))));
+//
+// gst_tag_list_foreach (tags, print_tag, NULL);
+// gst_tag_list_free (tags);
+// tags = NULL;
+// }
+// break;
+// }
+// default:
+// gst_message_unref (message);
+// break;
+// }
+// }
+//}
+
+int
+gst_play_file (const char* file)
+{
+ GstElement *filesrc, *decodebin, *sink;
+ GstCaps* caps;
+ //int length = strlen( file );
+ //gst_init (&argc, &argv);
+
+ if (file == NULL) {
+ //g_print ("file is not present");
+ goto no_output;
+ }
+
+ //g_print ("Constructing pipeline\n");
+
+ /* create a new bin to hold the elements */
+ bin = gst_pipeline_new ("pipeline");
+ if(!bin)
+ goto no_output;
+
+ /* create a disk reader */
+ filesrc = gst_element_factory_make ("filesrc", "disk_source");
+ if(!filesrc)
+ goto no_output;
+
+ g_object_set (G_OBJECT (filesrc), "location", file, NULL);
+
+ if( g_str_has_suffix (file, "raw") )
+ {
+ sink = gst_element_factory_make ("devsoundsink", "sink");
+ caps = gst_caps_new_simple ("audio/x-raw-int",
+ "width", G_TYPE_INT, 16,
+ "depth", G_TYPE_INT, 16,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+ gst_bin_add_many (GST_BIN (bin), filesrc, sink, NULL);
+
+ gst_element_link_filtered (filesrc, sink, caps);
+ }
+ else if( g_str_has_suffix (file, "g711") )
+ {
+ sink = gst_element_factory_make ("devsoundsink", "sink");
+ caps = gst_caps_new_simple ("audio/x-alaw",
+ "width", G_TYPE_INT, 16,
+ "depth", G_TYPE_INT, 16,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+ gst_bin_add_many (GST_BIN (bin), filesrc, sink, NULL);
+
+ gst_element_link_filtered (filesrc, sink, caps);
+ }
+ else if( g_str_has_suffix (file, "g729") )
+ {
+ sink = gst_element_factory_make ("devsoundsink", "sink");
+ caps = gst_caps_new_simple ("audio/g729",
+ "width", G_TYPE_INT, 16,
+ "depth", G_TYPE_INT, 16,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+ gst_bin_add_many (GST_BIN (bin), filesrc, sink, NULL);
+
+ gst_element_link_filtered (filesrc, sink, caps);
+ }
+ else if( g_str_has_suffix (file, "ilbc") )
+ {
+ sink = gst_element_factory_make ("devsoundsink", "sink");
+
+ caps = gst_caps_new_simple ("audio/ilbc",
+ "width", G_TYPE_INT, 16,
+ "depth", G_TYPE_INT, 16,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+
+ gst_bin_add_many (GST_BIN (bin), filesrc, sink, NULL);
+
+ gst_element_link_filtered (filesrc, sink, caps);
+ }
+ else if( g_str_has_suffix (file, "amr") )
+ {
+ sink = gst_element_factory_make ("devsoundsink", "sink");
+ caps = gst_caps_new_simple ("audio/amr",
+ "width", G_TYPE_INT, 8,
+ "depth", G_TYPE_INT, 8,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+ gst_bin_add_many (GST_BIN (bin), filesrc, sink, NULL);
+
+ //gst_element_link (source, sink);
+ gst_element_link_filtered (filesrc, sink, caps);
+ }
+
+ else
+ {
+ /* Create the decodebin */
+ decodebin = gst_element_factory_make ("decodebin", NULL);
+ if (!decodebin) {
+ //g_print ("could not find the \"decodebin\" element\n");
+ return -1;
+ }
+
+ /* add objects to the main pipeline */
+ gst_bin_add_many (GST_BIN (bin), filesrc, decodebin, NULL);
+
+ /* link the elements. */
+ gst_element_link_many (filesrc, decodebin, NULL);
+
+ /* Connect to decodebin's 'new-decoded-pad' signal to detect when it produces
+ * a new stream */
+ g_signal_connect (G_OBJECT (decodebin), "new-decoded-pad",
+ G_CALLBACK (new_decoded_pad), bin);
+ }
+
+ gst_bus_add_watch( gst_pipeline_get_bus (GST_PIPELINE (bin)), bus_call, NULL);
+ //g_print ("Starting playback\n");
+ /* start playing */
+ gst_element_set_state (bin, GST_STATE_PLAYING);
+ return 0;
+
+no_output:
+ return -1;
+
+}
+
+
+int
+gst_record_file (int type)
+{
+ GstElement *audiosrc, *filesink;
+ char* carray = NULL;
+ GstCaps* caps;
+ //g_print ("Constructing pipeline\n");
+
+ /* switch case for recording type*/
+ switch( type )
+ {
+ case RECORD_RAW:
+ caps = gst_caps_new_simple ("audio/x-raw-int",
+ "width", G_TYPE_INT, 16,
+ "depth", G_TYPE_INT, 16,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+
+ carray = "c:\\data\\sounds\\Digital\\record.raw";
+ break;
+
+ case RECORD_AMR:
+ {
+ return gst_record_amr();
+ }
+ break;
+
+ case RECORD_G711:
+
+ caps = gst_caps_new_simple ("audio/x-alaw",
+ "width", G_TYPE_INT, 8,
+ "depth", G_TYPE_INT, 8,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+
+ carray = "c:\\data\\sounds\\Digital\\record.g711";
+ break;
+
+ case RECORD_G729: //
+
+ caps = gst_caps_new_simple ("audio/g729",
+ "width", G_TYPE_INT, 16,
+ "depth", G_TYPE_INT, 16,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+
+ carray = "c:\\data\\sounds\\Digital\\record.g729";
+ break;
+
+ case RECORD_ILBC: //
+
+ caps = gst_caps_new_simple ("audio/ilbc",
+ "width", G_TYPE_INT, 16,
+ "depth", G_TYPE_INT, 16,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+
+ carray = "c:\\data\\sounds\\Digital\\record.ilbc";
+ break;
+ case RECORD_WAV:
+ {
+ return gst_record_wav();
+ }
+ break;
+ case RECORD_AAC:
+ {
+ return gst_record_aac();
+ }
+ break;
+ default:
+ return -1;
+ break;
+ }
+ /* create a new bin to hold the elements */
+ bin = gst_pipeline_new ("pipeline");
+ if(!bin)
+ goto no_output;
+
+ /* create a disk reader */
+ audiosrc = gst_element_factory_make ("devsoundsrc", "audio_source");
+ if(!audiosrc)
+ goto no_output;
+
+ /* Create the decodebin */
+ filesink = gst_element_factory_make ("filesink", NULL);
+ if(!filesink)
+ goto no_output;
+
+ g_object_set (G_OBJECT (audiosrc),
+ "blocksize", 1280,
+ NULL);
+
+ g_object_set (G_OBJECT (filesink), "location", carray,"buffer-size",1280, NULL);
+
+ /* add objects to the main pipeline */
+ gst_bin_add_many (GST_BIN (bin), audiosrc, filesink, NULL);
+
+ /* link the elements. */
+ gst_element_link_filtered (audiosrc, filesink, caps);
+ //gst_element_link_many (audiosrc, filesink, NULL);
+ gst_bus_add_watch( gst_pipeline_get_bus (GST_PIPELINE (bin)), bus_call, NULL);
+
+ //g_print ("Starting recoring\n");
+ /* start playing */
+ gst_element_set_state (bin, GST_STATE_PLAYING);
+
+ /* Run event loop listening for bus messages until EOS or ERROR */
+ //event_loop (bin);
+
+// //g_print ("Finished playback - stopping pipeline\n");
+//
+// /* stop the bin */
+// gst_element_set_state (bin, GST_STATE_NULL);
+//
+// /* Unreffing the bin will clean up all its children too */
+// gst_object_unref (bin);
+//
+ return 0;
+no_output:
+ return -1;
+
+}
+
+
+int
+gst_record_wav ()
+{
+ GstElement *audiosrc, *filesink, *wavenc;
+ char* carray = NULL;
+ GstCaps* caps;
+
+ //g_print ("Constructing pipeline\n");
+
+ /* create a new bin to hold the elements */
+ bin = gst_pipeline_new ("pipeline");
+ if(!bin)
+ goto no_output;
+
+ /* create a disk reader */
+ audiosrc = gst_element_factory_make ("devsoundsrc", "audio_source");
+ if(!audiosrc)
+ goto no_output;
+
+ /* Create the decodebin */
+ filesink = gst_element_factory_make ("filesink", NULL);
+ if(!filesink)
+ goto no_output;
+
+ wavenc = gst_element_factory_make ("wavenc", NULL);
+ if(!wavenc)
+ goto no_output;
+
+ caps = gst_caps_new_simple ("audio/x-raw-int",
+ "width", G_TYPE_INT, 16,
+ "depth", G_TYPE_INT, 16,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 16000,
+ "channels", G_TYPE_INT, 1, NULL);
+
+ carray = "c:\\data\\sounds\\Digital\\record.wav";
+
+ g_object_set (G_OBJECT (audiosrc),
+ "blocksize", 1280,
+ NULL);
+
+ g_object_set (G_OBJECT (filesink), "location", carray,"buffer-size",1280, NULL);
+
+ /* add objects to the main pipeline */
+ gst_bin_add_many (GST_BIN (bin), audiosrc,wavenc, filesink, NULL);
+
+ /* link the elements. */
+ gst_element_link_filtered (audiosrc, wavenc, caps);
+ gst_element_link (wavenc, filesink);
+ gst_bus_add_watch( gst_pipeline_get_bus (GST_PIPELINE (bin)), bus_call, NULL);
+ //g_print ("Starting recoring\n");
+ /* start playing */
+ gst_element_set_state (bin, GST_STATE_PLAYING);
+
+ return 0;
+
+no_output:
+ return -1;
+}
+
+int gst_pause()
+{
+ gst_element_set_state (bin, GST_STATE_PAUSED);
+ return 0;
+}
+
+int gst_resume()
+{
+ gst_element_set_state (bin, GST_STATE_PLAYING);
+ return 0;
+}
+
+
+int gst_record_stop()
+{
+ gst_element_send_event (bin, gst_event_new_eos ());
+ //gst_element_set_state (bin, GST_STATE_NULL);
+ return 0;
+}
+
+
+int gst_seek()
+{
+// need to implement..
+}
+
+int gst_get_events()
+{
+ return g_main_context_iteration(NULL, FALSE);
+ //return 0;
+}
+
+int gst_unref()
+{
+ //g_print ("Finished playback - stopping pipeline\n");
+ /* stop the bin */
+ gst_element_set_state (bin, GST_STATE_NULL);
+ /* Unreffing the bin will clean up all its children too */
+ gst_object_unref (bin);
+ return 0;
+}
+
+int gst_record_aac()
+{
+ GstElement *audiosrc,*filesink,*aacenc, *mp4mux;
+ GstBus *bus;
+ GstPad *mp4sinkpad,*aacencsrcpad;
+ char* carray = NULL;
+ GstCaps* caps;
+
+ /*create a pipeline*/
+ bin = gst_pipeline_new ("pipeline");
+ if(!bin)
+ goto no_output;
+ /* create a disk reader */
+ audiosrc = gst_element_factory_make ("devsoundsrc", "audio_source");
+ if(!audiosrc)
+ goto no_output;
+
+ /* Create the decodebin */
+ filesink = gst_element_factory_make ("filesink", NULL);
+ if(!filesink)
+ goto no_output;
+ //setting num-buffers
+ //g_object_set (G_OBJECT (audiosrc), "num-buffers", 5000 , NULL);
+ g_object_set (G_OBJECT (audiosrc),
+ "blocksize", 1280,
+ NULL);
+
+ aacenc = gst_element_factory_make("nokiaaacenc", "nokiaaacenc");
+ if(!aacenc)
+ goto no_output;
+ mp4mux = gst_element_factory_make("mp4mux", "mp4mux");
+ if(!mp4mux)
+ goto no_output;
+ caps = gst_caps_new_simple("audio/x-raw-int",
+ "width", G_TYPE_INT, 16,
+ "depth", G_TYPE_INT, 16,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+ carray = "c:\\data\\sounds\\Digital\\record.mp4";
+
+
+ g_object_set(G_OBJECT (filesink), "location", carray, NULL);
+ bus = gst_pipeline_get_bus(GST_PIPELINE (bin));
+
+ gst_bus_add_watch(bus, bus_call, NULL);
+
+ gst_object_unref(bus);
+
+
+ //add objects to the main pipeline
+ gst_bin_add_many(GST_BIN (bin),audiosrc,aacenc,mp4mux,filesink, NULL);
+
+ gst_element_link_filtered (audiosrc, aacenc, caps);
+
+ mp4sinkpad = gst_element_get_request_pad( mp4mux, "audio_%d");
+
+ aacencsrcpad = gst_element_get_pad( aacenc, "src");
+ if (gst_pad_link (aacencsrcpad,mp4sinkpad) != GST_PAD_LINK_OK) {
+
+ g_print("gst_pad_link (aacencsrcpad,mp4sinkpad) failed");
+
+ return -1;
+ }
+ //gst_element_link (aacenc, filesink);
+ gst_element_link (mp4mux, filesink);
+
+ gst_caps_unref (caps);
+
+
+ gst_element_set_state(bin, GST_STATE_PLAYING);
+
+ return 0;
+no_output:
+ return -1;
+}
+
+int gst_record_amr()
+{
+ GstElement *audiosrc, *filesink, *amrmux;
+ GstBus *bus;
+ char* carray = NULL;
+ GstCaps* caps;
+ /* create a new bin to hold the elements */
+ bin = gst_pipeline_new ("pipeline");
+ if(!bin)
+ goto no_output;
+ //g_print ("pipeline created");
+ audiosrc = gst_element_factory_make ("devsoundsrc", "audio_source");
+ // encoder = gst_element_factory_make ("wavenc", NULL);
+ if(!audiosrc)
+ goto no_output;
+
+ amrmux = gst_element_factory_make ("amrmux", "muxer");
+ if(!amrmux)
+ goto no_output;
+
+ filesink = gst_element_factory_make("filesink", "filesink");
+ if(!filesink)
+ goto no_output;
+
+ caps = gst_caps_new_simple ("audio/amr",
+ "width", G_TYPE_INT, 8,
+ "depth", G_TYPE_INT, 8,
+ "signed",G_TYPE_BOOLEAN, TRUE,
+ "endianness",G_TYPE_INT, G_BYTE_ORDER,
+ "rate", G_TYPE_INT, 8000,
+ "channels", G_TYPE_INT, 1, NULL);
+ carray = "c:\\data\\sounds\\Digital\\record.amr";
+
+ g_object_set (G_OBJECT (audiosrc),
+ "blocksize", 1280,
+ NULL);
+
+ g_object_set(G_OBJECT (filesink), "location", carray, NULL);
+
+ bus = gst_pipeline_get_bus (GST_PIPELINE (bin));
+ gst_bus_add_watch (bus, bus_call, NULL);
+ gst_object_unref (bus);
+
+
+ /* add objects to the main pipeline */
+ gst_bin_add_many(GST_BIN (bin),audiosrc,amrmux,filesink , NULL);
+ /* link the elements */
+ gst_element_link_filtered (audiosrc, amrmux, caps);
+
+ gst_element_link( amrmux, filesink );
+
+ gst_element_set_state (bin, GST_STATE_PLAYING);
+
+ return 0;
+no_output:
+ return -1;
+
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/record_play.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/record_play.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+*
+* 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 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., 59 Temple Place - Suite 330,
+* Boston, MA 02111-1307, USA.
+*
+* Description:
+*
+*/
+
+#ifndef __HELP_FILE_H__
+#define __HELP_FILE_H__
+#include
+#include
+
+enum
+{
+ NONE,
+ PLAYING,
+ STOP,
+ PAUSE,
+ /*RESUME,
+ RECORDING*/
+};
+
+enum
+{
+ RECORD_NONE,
+ RECORD_AMR,
+ RECORD_WAV,
+ RECORD_RAW,
+ RECORD_G711,
+ RECORD_G729,
+ RECORD_ILBC,
+ RECORD_AAC
+};
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+int gst_play_file( const char* file );
+
+int gst_record_file( int type );
+
+int gst_record_wav();
+
+int gst_pause();
+
+int gst_resume();
+
+int gst_record_stop();
+
+int gst_seek();
+
+int gst_unref();
+
+int gst_get_events();
+
+int gst_record_aac();
+
+int gst_record_amr();
+
+#ifdef __cplusplus
+}
+#endif
+#endif //__HELP_FILE_H__
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/settings.png
Binary file QtGSTPlayer/settings.png has changed
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/views.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/views.cpp Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,31 @@
+#include
+#include
+//#include
+
+#include "views.h"
+
+// Helper methods for retrieving the views used in this application
+namespace Views {
+
+ // Store the mainwindow ptr here because we cannot call HbWidget::mainWindow() from these static functions.
+ HbMainWindow *win;
+
+/*!
+ Returns the pointer to folder view.
+*/
+ HbView *folderView()
+ {
+ // 0 since folderView was added first to the main window
+ return win->viewAt(0);
+ }
+
+/*!
+ Returns the pointer to settings view.
+*/
+ /* HbFormView *settingsView()
+ {
+ // 1 since settingsView was the second view added
+ return static_cast(win->viewAt(1));
+ }
+ */
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 QtGSTPlayer/views.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QtGSTPlayer/views.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,15 @@
+#ifndef VIEWS_H
+#define VIEWS_H
+
+class HbView;
+//class HbFormView;
+class HbMainWindow;
+
+namespace Views
+{
+ extern HbMainWindow *win;
+ HbView *folderView();
+ //HbFormView *settingsView();
+}
+
+#endif // VIEWS_H
diff -r 4b0c6ed43234 -r 8e837d1bf446 data/gst_dll_2001F41F.txt
--- a/data/gst_dll_2001F41F.txt Wed Mar 24 17:58:42 2010 -0500
+++ b/data/gst_dll_2001F41F.txt Wed Mar 24 18:04:17 2010 -0500
@@ -7,6 +7,7 @@
libgstdecodebin2.dll
libgstdevsoundsink.dll
libgstdevsoundsrc.dll
+libgstapp.dll
libgstqueue2.dll
libgstadder.dll
libgsttypefindfunctions.dll
@@ -14,9 +15,27 @@
libgstwavparse.dll
libgstaudiotestsrc.dll
libgstautodetect.dll
-libgstsubparse.dll
-libgsttcp.dll
-libgstvolume.dll
+libgstmad.dll
+libgstvideorate.dll
+libgstvideoscale.dll
+libgstvideotestsrc.dll
+libgstavi.dll
+libgstffmpegcolorspace.dll
+libgstmpegstream.dll
+libgstmpeg2dec.dll
+libgstsdlvideosink.dll
+libgstauparse.dll
+libgstqtdemux.dll
+gstqtmux.dll
+libgstnokiaaacenc.dll
+libgstlibgstqueue2.dll
+libgstjpeg.dll
libgstplaybin.dll
libgstgdp.dll
-libgstapp.dll
\ No newline at end of file
+libgstvolume.dll
+libgsttcp.dll
+libgstsubparse.dll
+libgstaudiofx.dll
+libgstmulaw.dll
+libgstalaw.dll
+libgstamrmux.dll
diff -r 4b0c6ed43234 -r 8e837d1bf446 group/bld.inf
--- a/group/bld.inf Wed Mar 24 17:58:42 2010 -0500
+++ b/group/bld.inf Wed Mar 24 18:04:17 2010 -0500
@@ -21,10 +21,11 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
-* Description:
+* Description : This is a top level bld file to generate all libraries.
*
*/
+
#include
PRJ_PLATFORMS
@@ -37,6 +38,7 @@
#include "../gst_plugins_good/group/bld.inf"
#include "../gst_plugins_symbian/group/bld.inf"
#include "../gstregistrygenerator/group/bld.inf"
+#include "../gst_nokia_speech/group/bld.inf"
#endif
PRJ_EXPORTS
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_nokia_speech/bwins/libgstnokiaaacencu.def
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_nokia_speech/bwins/libgstnokiaaacencu.def Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,4 @@
+EXPORTS
+ _GST_PLUGIN_DESC @ 1 NONAME
+ gst_aac_enc_get_type @ 2 NONAME
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_nokia_speech/config.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_nokia_speech/config.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,274 @@
+/* config.h. Generated by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* defined if cdda headers are in a cdda/ directory */
+/* #undef CDPARANOIA_HEADERS_IN_DIR */
+
+/* Default audio sink */
+#define DEFAULT_AUDIOSINK "autoaudiosink"
+
+/* Default audio source */
+#define DEFAULT_AUDIOSRC "alsasrc"
+
+/* Default video sink */
+#define DEFAULT_VIDEOSINK "autovideosink"
+
+/* Default video source */
+#define DEFAULT_VIDEOSRC "v4lsrc"
+
+/* Default visualizer */
+#define DEFAULT_VISUALIZER "goom"
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+#ifdef __SYMBIAN32__
+#undef ENABLE_NLS
+#else
+#define ENABLE_NLS 1
+#endif
+
+
+/* gettext package name */
+#define GETTEXT_PACKAGE "gst-plugins-base-0.10"
+
+/* macro to use to show function name */
+#define GST_FUNCTION __PRETTY_FUNCTION__
+
+/* Defined if gcov is enabled to force a rebuild due to config.h changing */
+/* #undef GST_GCOV_ENABLED */
+
+/* Default errorlevel to use */
+#define GST_LEVEL_DEFAULT GST_LEVEL_NONE
+
+/* GStreamer license */
+#define GST_LICENSE "LGPL"
+
+/* package name in plugins */
+#define GST_PACKAGE_NAME "GStreamer Base Plug-ins source release"
+
+/* package origin */
+#define GST_PACKAGE_ORIGIN "Unknown package origin"
+
+/* support for features: gstalsa */
+#define HAVE_ALSA
+
+/* support for features: cdparanoia */
+/* #undef HAVE_CDPARANOIA */
+
+/* Define if the host CPU is an Alpha */
+/* #undef HAVE_CPU_ALPHA */
+
+/* Define if the host CPU is an ARM */
+/* #undef HAVE_CPU_ARM */
+#ifdef __SYMBIAN32__
+#define HAVE_CPU_ARM 1
+#endif
+
+/* Define if the host CPU is a CRIS */
+/* #undef HAVE_CPU_CRIS */
+
+/* Define if the host CPU is a CRISv32 */
+/* #undef HAVE_CPU_CRISV32 */
+
+/* Define if the host CPU is a HPPA */
+/* #undef HAVE_CPU_HPPA */
+
+/* Define if the host CPU is an x86 */
+#ifndef __SYMBIAN32__
+#define HAVE_CPU_I386 1
+#endif
+/* Define if the host CPU is a IA64 */
+/* #undef HAVE_CPU_IA64 */
+
+/* Define if the host CPU is a M68K */
+/* #undef HAVE_CPU_M68K */
+
+/* Define if the host CPU is a MIPS */
+/* #undef HAVE_CPU_MIPS */
+
+/* Define if the host CPU is a PowerPC */
+/* #undef HAVE_CPU_PPC */
+
+/* Define if the host CPU is a 64 bit PowerPC */
+/* #undef HAVE_CPU_PPC64 */
+
+/* Define if the host CPU is a S390 */
+/* #undef HAVE_CPU_S390 */
+
+/* Define if the host CPU is a SPARC */
+/* #undef HAVE_CPU_SPARC */
+
+/* Define if the host CPU is a x86_64 */
+/* #undef HAVE_CPU_X86_64 */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#define HAVE_DCGETTEXT 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_DLFCN_H 1
+
+/* support for features: */
+#define HAVE_EXTERNAL
+
+/* FIONREAD ioctl found in sys/filio.h */
+/* #undef HAVE_FIONREAD_IN_SYS_FILIO */
+
+/* FIONREAD ioctl found in sys/ioclt.h */
+#define HAVE_FIONREAD_IN_SYS_IOCTL 1
+
+/* defined if the compiler implements __func__ */
+#define HAVE_FUNC 1
+
+/* defined if the compiler implements __FUNCTION__ */
+#define HAVE_FUNCTION 1
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#define HAVE_GETTEXT 1
+
+/* support for features: gnomevfssrc */
+#define HAVE_GNOME_VFS
+
+/* support for features: v4lsrc v4lmjpegsrc v4lmjpegsink */
+#define HAVE_GST_V4L
+
+/* Define if you have the iconv() function. */
+/* #undef HAVE_ICONV */
+
+/* Define to 1 if you have the header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `asound' library (-lasound). */
+/* #undef HAVE_LIBASOUND */
+
+/* support for features: libvisual */
+/* #undef HAVE_LIBVISUAL */
+
+/* Define if you have C99's lrint function. */
+#define HAVE_LRINT 1
+
+/* Define if you have C99's lrintf function. */
+#define HAVE_LRINTF 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_MEMORY_H 1
+
+/* support for features: oggdemux oggmux */
+#define HAVE_OGG
+
+/* support for features: pango */
+#define HAVE_PANGO
+
+/* defined if the compiler implements __PRETTY_FUNCTION__ */
+#define HAVE_PRETTY_FUNCTION 1
+
+/* Define if RDTSC is available */
+#define HAVE_RDTSC 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_REGEX_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* support for features: theoradec theoraenc */
+/* #undef HAVE_THEORA */
+
+/* Define to 1 if you have the header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if valgrind should be used */
+#define HAVE_VALGRIND 1
+
+/* support for features: vorbisenc vorbisdec */
+#define HAVE_VORBIS
+
+/* defined if vorbis_synthesis_restart is present */
+#define HAVE_VORBIS_SYNTHESIS_RESTART 1
+
+/* support for features: ximagesink */
+#define HAVE_X
+
+/* support for features: xshm */
+#define HAVE_XSHM
+
+/* support for features: xvimagesink */
+#define HAVE_XVIDEO
+
+/* gettext locale dir */
+#define LOCALEDIR "/home/datha/gst-plugins-base-0.10.8/share/locale"
+
+/* Name of package */
+#define PACKAGE "gst-plugins-base"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "GStreamer nokia speech"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "GStreamer nokia speech"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "gst_nokia_speech"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "0.10.0"
+
+/* directory where plugins are located */
+
+/* The size of a `char', as computed by sizeof. */
+/* #undef SIZEOF_CHAR */
+
+/* The size of a `int', as computed by sizeof. */
+/* #undef SIZEOF_INT */
+
+/* The size of a `long', as computed by sizeof. */
+/* #undef SIZEOF_LONG */
+
+/* The size of a `short', as computed by sizeof. */
+/* #undef SIZEOF_SHORT */
+
+/* The size of a `void*', as computed by sizeof. */
+/* #undef SIZEOF_VOIDP */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "0.10.0"
+
+/* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
+/* #undef WORDS_BIGENDIAN */
+
+/* Define to 1 if the X Window System is missing or not being used. */
+/* #undef X_DISPLAY_MISSING */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_nokia_speech/eabi/libgstnokiaaacencu.def
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_nokia_speech/eabi/libgstnokiaaacencu.def Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,4 @@
+EXPORTS
+ _GST_PLUGIN_DESC @ 1 NONAME
+ gst_aac_enc_get_type @ 2 NONAME
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_nokia_speech/group/bld.inf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_nokia_speech/group/bld.inf Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,9 @@
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+#ifndef WINSCW
+gstaacenc.mmp
+#endif
\ No newline at end of file
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_nokia_speech/group/gstaacenc.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_nokia_speech/group/gstaacenc.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,87 @@
+// Gstreamer.MMP
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
+*
+* 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 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., 59 Temple Place - Suite 330,
+* Boston, MA 02111-1307, USA.
+*
+* Description:
+*
+*/
+
+#include
+
+TARGET libgstnokiaaacenc.dll
+TARGETTYPE DLL
+UID 0x20004c45 0x0FE80A1C
+
+#ifdef EKA2
+LANG SC
+CAPABILITY All -Tcb
+VENDORID VID_DEFAULT
+#endif
+
+#if !defined(__WINSCW__) && !defined(__WINS__)
+EpocAllowDllData
+#endif
+
+MACRO HAVE_CONFIG_H //RAW_FRAME_SIZE
+
+
+USERINCLUDE ..
+
+MW_LAYER_SYSTEMINCLUDE
+OS_LAYER_LIBC_SYSTEMINCLUDE
+OS_LAYER_GLIB_SYSTEMINCLUDE
+
+USERINCLUDE ../../include/gstreamer
+USERINCLUDE ../../include/gstreamer/gst
+USERINCLUDE ../../include/gstreamer/gst/base
+USERINCLUDE ../../include/gstreamer/gst/controller
+USERINCLUDE ../../include/gstreamer/gst/dataprotocol
+USERINCLUDE ../../include/gstreamer/gst/net
+USERINCLUDE ../../include/gstreamer/gst/audio
+USERINCLUDE ../../include/gstreamer/gst/cdda
+USERINCLUDE ../../include/gstreamer/gst/floatcast
+USERINCLUDE ../../include/gstreamer/gst/interfaces
+USERINCLUDE ../../include/gstreamer/gst/netbuffer
+USERINCLUDE ../../include/gstreamer/gst/riff
+USERINCLUDE ../../include/gstreamer/gst/rtp
+USERINCLUDE ../../include/gstreamer/gst/tag
+USERINCLUDE ../../include/gstreamer/gst/video
+SYSTEMINCLUDE /epoc32/include/internal
+SOURCEPATH ..
+SOURCE gstaacenc.c gstframedaudioenc.c
+LIBRARY euser.lib
+LIBRARY libc.lib
+LIBRARY libdl.lib
+LIBRARY libglib.lib
+LIBRARY libgmodule.lib
+
+LIBRARY libgobject.lib
+LIBRARY libgthread.lib
+LIBRARY libm.lib
+LIBRARY libz.lib
+LIBRARY libgstreamer.lib
+LIBRARY enhaacplusencoder.lib
+LIBRARY libgstbase.lib
+
+#ifdef WINSCW
+LIBRARY ewsd.lib //wsd solution
+#endif
+
+
+
+SMPSAFE
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_nokia_speech/gstaacenc.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_nokia_speech/gstaacenc.c Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,603 @@
+/* GStreamer AAC encoder
+ * Copyright 2009 Collabora Multimedia,
+ * Copyright 2009 Nokia Corporation
+ * @author: Mark Nauwelaerts .
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/* TODO non-GPL license */
+
+/**
+ * SECTION:element-nokiaaacenc
+ * @seealso: nokiaaacdec
+ *
+ * nokiaaacenc encodes raw audio to AAC streams.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include
+#include
+#include
+
+#include "gstaacenc.h"
+
+GST_DEBUG_CATEGORY_STATIC (aac_enc);
+#define GST_CAT_DEFAULT aac_enc
+
+enum
+{
+ AAC_PROFILE_AUTO = 0,
+ AAC_PROFILE_LC = 2,
+ AAC_PROFILE_HE = 5
+};
+
+#define GST_TYPE_AAC_ENC_PROFILE (gst_aac_enc_profile_get_type ())
+static GType
+gst_aac_enc_profile_get_type (void)
+{
+ static GType gst_aac_enc_profile_type = 0;
+
+ if (!gst_aac_enc_profile_type) {
+ static GEnumValue gst_aac_enc_profile[] = {
+ {AAC_PROFILE_AUTO, "Codec selects LC or HE", "AUTO"},
+ {AAC_PROFILE_LC, "Low complexity profile", "LC"},
+ {AAC_PROFILE_HE, "High Efficiency", "HE"},
+ {0, NULL, NULL},
+ };
+
+ gst_aac_enc_profile_type = g_enum_register_static ("GstNokiaAacEncProfile",
+ gst_aac_enc_profile);
+ }
+
+ return gst_aac_enc_profile_type;
+}
+
+#define GST_TYPE_AAC_ENC_OUTPUTFORMAT (gst_aac_enc_outputformat_get_type ())
+static GType
+gst_aac_enc_outputformat_get_type (void)
+{
+ static GType gst_aac_enc_outputformat_type = 0;
+
+ if (!gst_aac_enc_outputformat_type) {
+ static GEnumValue gst_aac_enc_outputformat[] = {
+ {RAW, "AAC Raw format", "RAW"},
+ {USE_ADTS, "Audio Data Transport Stream format", "ADTS"},
+ {USE_ADIF, "Audio Data Interchange Format", "ADIF"},
+ {0, NULL, NULL},
+ };
+
+ gst_aac_enc_outputformat_type =
+ g_enum_register_static ("GstNokiaAacEncOutputFormat",
+ gst_aac_enc_outputformat);
+ }
+
+ return gst_aac_enc_outputformat_type;
+}
+
+enum
+{
+ PROP_0,
+ PROP_BITRATE,
+ PROP_PROFILE,
+ PROP_FORMAT
+};
+
+static GstStaticPadTemplate gst_aac_enc_sink_template =
+GST_STATIC_PAD_TEMPLATE ("sink",
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("audio/x-raw-int, "
+ "endianness = (int) BYTE_ORDER, "
+ "signed = (bool) TRUE, "
+ "width = (int) 16, "
+ "depth = (int) 16, "
+ "rate = (int) [ 8000, 96000 ], channels = (int) [ 1, 2 ] ")
+ );
+
+static GstStaticPadTemplate gst_aac_enc_src_template =
+GST_STATIC_PAD_TEMPLATE ("src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_STATIC_CAPS ("audio/mpeg, " "mpegversion = (int) 4, "
+ "rate = (int) [ 8000, 96000 ], channels = (int) [ 1, 2 ] ")
+ );
+
+static void gst_aac_enc_base_init (gpointer g_class);
+static void gst_aac_enc_class_init (GstAACEncClass * klass);
+static void gst_aac_enc_init (GstAACEnc * filter, GstAACEncClass * klass);
+
+static void gst_aac_enc_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec);
+static void gst_aac_enc_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec);
+
+static void gst_aac_enc_finalize (GObject * object);
+static void gst_aac_enc_reset (GstAACEnc * enc);
+static GstStateChangeReturn gst_aac_enc_change_state (GstElement * element,
+ GstStateChange transition);
+static gboolean gst_aac_enc_sink_setcaps (GstPad * pad, GstCaps * caps);
+static GstFlowReturn gst_aac_enc_chain (GstPad * pad, GstBuffer * buffer);
+
+GST_BOILERPLATE (GstNokiaAACEnc, gst_aac_enc, GstElement, GST_TYPE_ELEMENT);
+
+static void
+gst_aac_enc_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details_simple (element_class,
+ "Nokia AAC encoder", "Codec/Encoder/Audio",
+ "Nokia AAC encoder",
+ "MCC, Mark Nauwelaerts ");
+
+ gst_element_class_add_pad_template (element_class,
+ gst_static_pad_template_get (&gst_aac_enc_src_template));
+ gst_element_class_add_pad_template (element_class,
+ gst_static_pad_template_get (&gst_aac_enc_sink_template));
+}
+
+/* initialize the plugin's class */
+static void
+gst_aac_enc_class_init (GstAACEncClass * klass)
+{
+ GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
+
+ gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
+
+ GST_DEBUG_CATEGORY_INIT (aac_enc, "nokiaaacenc", 0, "Nokia AAC encoder");
+
+ gobject_class->set_property = gst_aac_enc_set_property;
+ gobject_class->get_property = gst_aac_enc_get_property;
+ gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_aac_enc_finalize);
+
+ /* properties */
+ g_object_class_install_property (gobject_class, PROP_BITRATE,
+ g_param_spec_int ("bitrate", "Bitrate (bps)", "Bitrate in bits/sec",
+ 8 * 1000, 320 * 1000, 128 * 1000,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT)));
+ g_object_class_install_property (gobject_class, PROP_PROFILE,
+ g_param_spec_enum ("profile", "Profile",
+ "MPEG/AAC encoding profile",
+ GST_TYPE_AAC_ENC_PROFILE, AAC_PROFILE_LC,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (gobject_class, PROP_FORMAT,
+ g_param_spec_enum ("output-format", "Output format",
+ "Format of output frames",
+ GST_TYPE_AAC_ENC_OUTPUTFORMAT, RAW,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
+ gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_aac_enc_change_state);
+}
+
+static void
+gst_aac_enc_init (GstAACEnc * enc, GstAACEncClass * klass)
+{
+ enc->sinkpad =
+ gst_pad_new_from_static_template (&gst_aac_enc_sink_template, "sink");
+ gst_pad_set_setcaps_function (enc->sinkpad,
+ GST_DEBUG_FUNCPTR (gst_aac_enc_sink_setcaps));
+ gst_pad_set_chain_function (enc->sinkpad,
+ GST_DEBUG_FUNCPTR (gst_aac_enc_chain));
+ gst_element_add_pad (GST_ELEMENT (enc), enc->sinkpad);
+
+ enc->srcpad =
+ gst_pad_new_from_static_template (&gst_aac_enc_src_template, "src");
+ gst_pad_use_fixed_caps (enc->srcpad);
+ gst_element_add_pad (GST_ELEMENT (enc), enc->srcpad);
+
+#ifndef GST_DISABLE_GST_DEBUG
+ gst_framed_audio_enc_init (&enc->enc, GST_ELEMENT (enc), aac_enc);
+#else
+ gst_framed_audio_enc_init (&enc->enc, GST_ELEMENT (enc), NULL);
+#endif
+
+ gst_aac_enc_reset (enc);
+}
+
+static void
+gst_aac_enc_reset (GstAACEnc * enc)
+{
+ gst_framed_audio_enc_reset (&enc->enc);
+ if (enc->encoder)
+ EnAACPlus_Enc_Delete (enc->encoder);
+ enc->encoder = NULL;
+ g_free (enc->buffer);
+ enc->buffer = NULL;
+}
+
+static void
+gst_aac_enc_finalize (GObject * object)
+{
+ GstAACEnc *enc = (GstAACEnc *) object;
+
+ gst_framed_audio_enc_finalize (&enc->enc);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+static gboolean
+gst_aac_enc_setup_encoder (GstAACEnc * enc)
+{
+ AACPLUS_ENC_CONFIG enc_params;
+ AACPLUS_ENC_MODE mode;
+ gint rate, channels;
+ guint maxbitrate;
+
+ rate = enc->rate;
+ channels = enc->channels;
+
+ /* only up to 2 channels supported */
+ enc_params.sampleRate = rate;
+ enc_params.bitRate = enc->bitrate;
+ enc_params.nChannels = channels;
+ enc_params.aac_tools = USE_ALL;
+ enc_params.pcm_mode = 16;
+ enc_params.format = enc->format;
+
+ /* check, warn and correct if the max bitrate for the given samplerate is
+ * exceeded. Maximum of 6144 bit for a channel */
+ maxbitrate =
+ (guint) (6144.0 * (gdouble) rate / (gdouble) 1024.0 + .5) * channels;
+ if (enc_params.bitRate > maxbitrate) {
+ GST_ELEMENT_INFO (enc, RESOURCE, SETTINGS, (NULL),
+ ("bitrate %d exceeds maximum allowed bitrate of %d for samplerate %d "
+ "and %d channels. Setting bitrate to %d",
+ enc_params.bitRate, maxbitrate, rate, channels, maxbitrate));
+ enc_params.bitRate = maxbitrate;
+ }
+
+ /* set up encoder */
+ if (enc->encoder)
+ EnAACPlus_Enc_Delete (enc->encoder);
+
+ /* only these profiles are really known to and supported by codec */
+ switch (enc->profile) {
+ case AAC_PROFILE_LC:
+ mode = MODE_AACLC;
+ break;
+ case AAC_PROFILE_HE:
+ mode = MODE_EAACPLUS;
+ break;
+ case AAC_PROFILE_AUTO:
+ mode = MODE_AUTO;
+ break;
+ default:
+ mode = MODE_AACLC;
+ g_assert_not_reached ();
+ break;
+ }
+ enc->encoder = EnAACPlus_Enc_Create (&enc_params, mode);
+
+ if (!enc->encoder)
+ goto setup_failed;
+
+ /* query and setup params,
+ * also set up some buffers for fancy HE */
+ EnAACPlus_Enc_GetSetParam (enc->encoder, &enc->info);
+
+#define DUMP_FIELD(f) \
+ GST_DEBUG_OBJECT (enc, "encoder info: " G_STRINGIFY (f) " = %d", enc->info.f);
+
+ DUMP_FIELD (InBufSize);
+ DUMP_FIELD (OutBufSize);
+ DUMP_FIELD (Frame_Size);
+ DUMP_FIELD (writeOffset);
+ DUMP_FIELD (InBufSize);
+
+ enc->raw_frame_size = enc->info.Frame_Size;
+ enc->codec_frame_size = enc->info.OutBufSize;
+ enc->frame_duration =
+ GST_FRAMES_TO_CLOCK_TIME (enc->raw_frame_size / enc->channels / 2,
+ enc->rate);
+
+ g_free (enc->buffer);
+ /* safety margin */
+ enc->buffer = g_malloc (enc->info.InBufSize * 2);
+
+ return TRUE;
+
+ /* ERRORS */
+setup_failed:
+ {
+ GST_ELEMENT_ERROR (enc, LIBRARY, SETTINGS, (NULL), (NULL));
+ return FALSE;
+ }
+}
+
+static gint
+gst_aac_enc_rate_idx (gint rate)
+{
+ static int rates[] = {
+ 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025,
+ 8000, 7350
+ };
+ guint i;
+
+ for (i = 0; i < G_N_ELEMENTS (rates); ++i)
+ if (rates[i] == rate)
+ return i;
+
+ return 0xF;
+}
+
+static gboolean
+gst_aac_enc_sink_setcaps (GstPad * pad, GstCaps * caps)
+{
+ GstAACEnc *enc;
+ gboolean ret = TRUE;
+ GstStructure *s;
+ GstBuffer *buf = NULL;
+ gint rate, channels;
+
+ enc = GST_AAC_ENC (GST_PAD_PARENT (pad));
+
+ /* extract stream properties */
+ s = gst_caps_get_structure (caps, 0);
+
+ if (!s)
+ goto refuse_caps;
+
+ ret = gst_structure_get_int (s, "rate", &rate);
+ ret &= gst_structure_get_int (s, "channels", &channels);
+
+ if (!ret)
+ goto refuse_caps;
+
+ enc->rate = rate;
+ enc->channels = channels;
+
+ /* NOTE:
+ * - codec only supports LC or HE (= LC + SBR etc)
+ * - HE has (more) restrictive samplerate/channels/bitrate combination
+ * - AUTO makes codec select between LC or HE (depending on settings)
+ */
+
+ gst_aac_enc_setup_encoder (enc);
+ if (!enc->encoder)
+ return FALSE;
+
+ /* HE iff writeOffset <> 0 iff Frame_Size <> 1024 * 2 * channels */
+ if (enc->info.writeOffset)
+ rate /= 2;
+
+ /* create codec_data if raw output */
+ if (enc->format == RAW) {
+ gint rate_idx;
+ guint8 *data;
+
+ buf = gst_buffer_new_and_alloc (5);
+ data = GST_BUFFER_DATA (buf);
+ rate_idx = gst_aac_enc_rate_idx (rate);
+
+ GST_DEBUG_OBJECT (enc, "codec_data: profile=%d, sri=%d, channels=%d",
+ enc->profile, rate_idx, enc->channels);
+
+ /* always write LC profile, and use implicit signaling for HE SBR */
+ data[0] = ((2 & 0x1F) << 3) | ((rate_idx & 0xE) >> 1);
+ data[1] = ((rate_idx & 0x1) << 7);
+ if (rate_idx != 0x0F) {
+ data[1] |= ((channels & 0xF) << 3);
+ GST_BUFFER_SIZE (buf) = 2;
+ } else {
+ gint srate;
+
+ srate = rate << 7;
+ data[1] |= ((srate >> 24) & 0xFF);
+ data[2] = ((srate >> 16) & 0xFF);
+ data[3] = ((srate >> 8) & 0xFF);
+ data[4] = (srate & 0xFF);
+ data[4] |= ((channels & 0xF) << 3);
+ GST_BUFFER_SIZE (buf) = 5;
+ }
+ }
+
+ /* fix some in src template */
+ caps = gst_caps_copy (gst_pad_get_pad_template_caps (enc->srcpad));
+ gst_caps_set_simple (caps, "rate", G_TYPE_INT, rate,
+ "channels", G_TYPE_INT, channels, NULL);
+ if (buf) {
+ gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, buf, NULL);
+ gst_buffer_unref (buf);
+ }
+ ret = gst_pad_set_caps (enc->srcpad, caps);
+ gst_caps_unref (caps);
+
+ return ret;
+
+ /* ERRORS */
+refuse_caps:
+ {
+ GST_WARNING_OBJECT (enc, "refused caps %" GST_PTR_FORMAT, caps);
+ return FALSE;
+ }
+}
+
+static gint
+gst_aac_enc_get_data (GstElement * element, const guint8 * in, guint8 * out,
+ GstDtxDecision * dtx)
+{
+ GstAACEnc *enc;
+ gint res;
+ gint offset;
+ UWord32 used, encoded;
+ Word8 *inbuffer;
+
+ enc = GST_AAC_ENC_CAST (element);
+
+ offset = enc->info.writeOffset;
+ if (offset) {
+ memcpy (enc->buffer + offset, in, enc->raw_frame_size);
+ inbuffer = (Word8 *) enc->buffer;
+ } else {
+ inbuffer = (Word8 *) in;
+ }
+
+ res = EnAACPlus_Enc_Encode (enc->encoder, &enc->info, inbuffer, &used,
+ (UWord8 *) out, &encoded);
+
+ if (offset) {
+ memcpy (enc->buffer, enc->buffer + used, offset);
+ }
+
+ return res == 0 ? encoded : -1;
+}
+
+/* set parameters */
+#define AUDIO_SAMPLE_RATE ((GST_AAC_ENC (enc->element))->rate)
+#define RAW_FRAME_SIZE ((GST_AAC_ENC (enc->element))->raw_frame_size)
+/* safe maximum frame size */
+#define CODEC_FRAME_SIZE ((GST_AAC_ENC (enc->element))->codec_frame_size)
+/* do not set variable frame;
+ * this will make every frame act as a silence frame and force output */
+/* #define CODEC_FRAME_VARIABLE 1 */
+#define FRAME_DURATION ((GST_AAC_ENC (enc->element))->frame_duration)
+#define codec_get_data(enc, in, out, dtx) \
+ gst_aac_enc_get_data (enc, in, out, dtx)
+
+/* and include code */
+#include "gstframedaudioenc.c"
+
+static GstFlowReturn
+gst_aac_enc_chain (GstPad * pad, GstBuffer * buf)
+{
+ GstAACEnc *enc;
+
+ enc = GST_AAC_ENC (GST_PAD_PARENT (pad));
+
+ if (G_UNLIKELY (enc->encoder == NULL))
+ goto not_negotiated;
+
+ return gst_framed_audio_enc_chain (&enc->enc, buf, enc->srcpad, &enc->cnpad);
+
+ /* ERRORS */
+not_negotiated:
+ {
+ GST_ELEMENT_ERROR (enc, CORE, NEGOTIATION, (NULL),
+ ("format wasn't negotiated before chain function"));
+ gst_buffer_unref (buf);
+ return GST_FLOW_NOT_NEGOTIATED;
+ }
+}
+
+static void
+gst_aac_enc_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec)
+{
+ GstAACEnc *enc;
+
+ enc = GST_AAC_ENC (object);
+
+ switch (prop_id) {
+ case PROP_BITRATE:
+ enc->bitrate = g_value_get_int (value);
+ break;
+ case PROP_PROFILE:
+ enc->profile = g_value_get_enum (value);
+ break;
+ case PROP_FORMAT:
+ enc->format = g_value_get_enum (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+gst_aac_enc_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec)
+{
+ GstAACEnc *enc;
+
+ enc = GST_AAC_ENC (object);
+
+ switch (prop_id) {
+ case PROP_BITRATE:
+ g_value_set_int (value, enc->bitrate);
+ break;
+ case PROP_PROFILE:
+ g_value_set_enum (value, enc->profile);
+ break;
+ case PROP_FORMAT:
+ g_value_set_enum (value, enc->format);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static GstStateChangeReturn
+gst_aac_enc_change_state (GstElement * element, GstStateChange transition)
+{
+ GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
+ GstAACEnc *enc = GST_AAC_ENC (element);
+
+ switch (transition) {
+ case GST_STATE_CHANGE_NULL_TO_READY:
+ break;
+ case GST_STATE_CHANGE_READY_TO_PAUSED:
+ break;
+ default:
+ break;
+ }
+
+ ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+ if (ret == GST_STATE_CHANGE_FAILURE)
+ return ret;
+
+ switch (transition) {
+ case GST_STATE_CHANGE_PAUSED_TO_READY:
+ gst_aac_enc_reset (enc);
+ break;
+ case GST_STATE_CHANGE_READY_TO_NULL:
+ break;
+ default:
+ break;
+ }
+
+ return ret;
+}
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+
+ if (!gst_element_register (plugin, "nokiaaacenc", GST_RANK_SECONDARY,
+ GST_TYPE_AAC_ENC))
+ return FALSE;
+
+ return TRUE;
+}
+
+/* this is the structure that gst-register looks for
+ * so keep the name plugin_desc, or you cannot get your plug-in registered */
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "nokiaaacenc",
+ "Nokia AAC MCC codec",
+ plugin_init, VERSION, "Proprietary", "gst-nokia-speech", "")
+
+EXPORT_C GstPluginDesc* _GST_PLUGIN_DESC()
+ {
+ return &gst_plugin_desc;
+ }
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_nokia_speech/gstaacenc.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_nokia_speech/gstaacenc.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,92 @@
+/* GStreamer AAC encoder
+ * Copyright 2009 Collabora Multimedia,
+ * Copyright 2009 Nokia Corporation
+ * @author: Mark Nauwelaerts .
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/* TODO non-GPL license */
+
+#ifndef __GST_AAC_ENC_H__
+#define __GST_AAC_ENC_H__
+
+#include
+
+#include
+
+#include "gstframedaudioenc.h"
+
+G_BEGIN_DECLS
+
+/* #define's don't like whitespacey bits */
+#define GST_TYPE_AAC_ENC \
+ (gst_aac_enc_get_type())
+#define GST_AAC_ENC(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AAC_ENC,GstAACEnc))
+#define GST_AAC_ENC_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AAC_ENC,GstAACEncClass))
+#define GST_IS_AAC_ENC(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AAC_ENC))
+#define GST_IS_AAC_ENC_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AAC_ENC))
+#define GST_AAC_ENC_CAST(obj) ((GstAACEnc*)(obj))
+
+
+typedef struct _GstNokiaAACEnc GstNokiaAACEnc;
+typedef struct _GstNokiaAACEncClass GstNokiaAACEncClass;
+
+typedef GstNokiaAACEnc GstAACEnc;
+typedef GstNokiaAACEncClass GstAACEncClass;
+
+struct _GstNokiaAACEnc
+{
+ GstElement element;
+
+ GstPad *sinkpad, *srcpad, *cnpad;
+
+ GstFramedAudioEnc enc;
+ HANDLE_AACPLUS_ENC encoder;
+ AACPLUS_ENC_INFO info;
+
+ /* mode selection */
+ GstClockTime frame_duration;
+ gint raw_frame_size;
+ gint codec_frame_size;
+
+ /* optional helper (history) buffer */
+ guint8 *buffer;
+
+ /* stream description */
+ gint rate;
+ gint channels;
+
+ /* properties */
+ gint bitrate;
+ guint profile;
+ guint format;
+};
+
+struct _GstNokiaAACEncClass
+{
+ GstElementClass parent_class;
+};
+
+GType gst_aac_enc_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GST_AAC_ENC_H__ */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_nokia_speech/gstframedaudioenc.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_nokia_speech/gstframedaudioenc.c Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,439 @@
+/* GStreamer Framed Audio Encoder
+ * Copyright 2009 Collabora Ltd,
+ * Copyright 2009 Nokia Corporation
+ * @author: Mark Nauwelaerts .
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include
+#include
+#include
+
+#include "gstframedaudioenc.h"
+
+/* generic part */
+#ifndef RAW_FRAME_SIZE
+
+/* this will reference caller's debug category;
+ * there is a copy of this per plugin lib (= debug category) */
+GST_DEBUG_CATEGORY_STATIC (framedaudioenc_debug);
+#define GST_CAT_DEFAULT framedaudioenc_debug
+
+void
+gst_framed_audio_enc_reset (GstFramedAudioEnc * enc)
+{
+ gst_adapter_clear (enc->adapter);
+ enc->next_ts = GST_CLOCK_TIME_NONE;
+}
+
+/* installs @enc as element private for @element's pad,
+ * and possibly some event and query handler.
+ * if these need overriding, chain up to them
+ * chain and setcaps still need to be set by @element */
+void
+gst_framed_audio_enc_init (GstFramedAudioEnc * enc, GstElement * element,
+ GstDebugCategory * cat)
+{
+ enc->element = element;
+#ifndef GST_DISABLE_GST_DEBUG
+ framedaudioenc_debug = cat;
+#endif
+
+ enc->adapter = gst_adapter_new ();
+
+ /* hook some */
+ enc->sinkpad = gst_element_get_pad (enc->element, "sink");
+ g_assert (enc->sinkpad);
+ gst_pad_set_element_private (enc->sinkpad, enc);
+
+ /* watch downstream events */
+ gst_pad_set_event_function (enc->sinkpad,
+ GST_DEBUG_FUNCPTR (gst_framed_audio_enc_sink_event));
+
+ gst_framed_audio_enc_reset (enc);
+}
+
+void
+gst_framed_audio_enc_finalize (GstFramedAudioEnc * enc)
+{
+ gst_object_unref (enc->adapter);
+
+ gst_pad_set_element_private (enc->sinkpad, NULL);
+ gst_object_unref (enc->sinkpad);
+}
+
+GstPad *
+gst_framed_audio_enc_request_new_pad (GstFramedAudioEnc * enc,
+ GstPadTemplate * templ, const gchar * req_name, GstPad ** pad_p)
+{
+ GstElement *element;
+ GstPad *newpad;
+ GstElementClass *klass;
+ GstCaps *caps;
+
+ g_return_val_if_fail (templ != NULL, NULL);
+
+ element = enc->element;
+ klass = GST_ELEMENT_GET_CLASS (element);
+
+ if (templ != gst_element_class_get_pad_template (klass, "cn"))
+ goto wrong_template;
+
+ GST_DEBUG_OBJECT (enc->element, "adding cn pad");
+ newpad = gst_pad_new_from_template (templ, "cn");
+ /* set template caps */
+ caps = gst_caps_copy (gst_pad_get_pad_template_caps (newpad));
+ gst_pad_set_caps (newpad, caps);
+ gst_caps_unref (caps);
+ gst_pad_use_fixed_caps (newpad);
+ gst_pad_set_active (newpad, TRUE);
+ /* only 1 pad by name can be added */
+ if (gst_element_add_pad (element, newpad)) {
+ GST_OBJECT_LOCK (element);
+ gst_object_replace ((GstObject **) pad_p, GST_OBJECT_CAST (newpad));
+ GST_OBJECT_UNLOCK (element);
+ GST_DEBUG_OBJECT (enc->element, "cn pad added");
+ } else {
+ gst_object_unref (newpad);
+ goto already_requested;
+ }
+
+ return newpad;
+
+ /* ERRORS */
+wrong_template:
+ {
+ GST_ERROR_OBJECT (element, "not our template!");
+ return NULL;
+ }
+already_requested:
+ {
+ GST_ERROR_OBJECT (element, "only 1 instance of a pad can be requested");
+ return NULL;
+ }
+}
+
+void
+gst_framed_audio_enc_release_pad (GstFramedAudioEnc * enc, GstPad * pad,
+ GstPad ** pad_p, void (disable_cn) (GstElement *))
+{
+ GstElement *element = enc->element;
+
+ GST_DEBUG_OBJECT (enc->element, "releasing cn pad");
+
+ GST_OBJECT_LOCK (element);
+ if (pad != *pad_p)
+ goto wrong_pad;
+ GST_OBJECT_UNLOCK (element);
+
+ /* reconfigure encoder */
+ disable_cn (element);
+
+ if (gst_element_remove_pad (element, pad)) {
+ GST_OBJECT_LOCK (element);
+ gst_object_replace ((GstObject **) pad_p, NULL);
+ GST_OBJECT_UNLOCK (element);
+ GST_DEBUG_OBJECT (enc->element, "cn pad released");
+ }
+
+ /* ERRORS */
+wrong_pad:
+ {
+ GST_OBJECT_UNLOCK (element);
+ GST_ERROR_OBJECT (element, "pad not requested; can not be released!");
+ return;
+ }
+}
+
+gboolean
+gst_framed_audio_enc_sink_event (GstPad * pad, GstEvent * event)
+{
+ GstFramedAudioEnc *enc;
+
+ enc = gst_pad_get_element_private (pad);
+ g_return_val_if_fail (enc, FALSE);
+
+ GST_LOG_OBJECT (enc->element, "received %s", GST_EVENT_TYPE_NAME (event));
+
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_FLUSH_STOP:
+ /* fall-through */
+ case GST_EVENT_EOS:
+ gst_adapter_clear (enc->adapter);
+ enc->next_ts = GST_CLOCK_TIME_NONE;
+ break;
+ default:
+ break;
+ }
+
+ return gst_pad_event_default (pad, event);
+}
+
+#else
+/* included part */
+
+/* parameters:
+ RAW_FRAME_SIZE
+ CODEC_FRAME_SIZE
+ FRAME_DURATION
+ AUDIO_SAMPLE_RATE (optional)
+ callback:
+ codec_get_data(enc, in, out, dtx)
+
+ If one does not mind a few cycles, include'ing can also be replaced by
+ a regular include & call, at the expense of some additional parameters
+ passed some way or another.
+*/
+
+#ifndef AUDIO_SAMPLE_RATE
+#define AUDIO_SAMPLE_RATE (8000)
+#endif
+
+/* quite some conditional stuff;
+ * the (ugly?) cost of trying to stay inner loop optimal */
+
+static GstFlowReturn
+gst_framed_audio_enc_chain (GstFramedAudioEnc * enc, GstBuffer * buf,
+ GstPad * srcpad, GstPad ** _cnpad)
+{
+ GstFlowReturn ret = GST_FLOW_OK;
+ GstBuffer *obuf = NULL;
+#ifdef CN_PAD
+ GstBuffer *cnbuf = NULL;
+ GstPad *cnpad = NULL;
+#endif
+ gboolean discont = FALSE;
+ const guint8 *data;
+ guint8 *odata;
+ gint av, flush, osize;
+
+#ifdef CN_PAD
+ GST_OBJECT_LOCK (enc->element);
+ if (_cnpad)
+ cnpad = *_cnpad;
+ if (cnpad)
+ gst_object_ref (cnpad);
+ GST_OBJECT_UNLOCK (enc->element);
+#endif
+
+ if (G_LIKELY (buf)) {
+ GST_LOG_OBJECT (enc->element, "input buffer of size %d with ts: %"
+ GST_TIME_FORMAT, GST_BUFFER_SIZE (buf),
+ GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
+ discont = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DISCONT);
+
+ /* reposition to the new buffer's timestamp,
+ * while correcting for some minor left-over */
+ if (GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
+ if (GST_CLOCK_TIME_IS_VALID (enc->next_ts)) {
+ GstClockTimeDiff diff, limit;
+ GstClockTime tleft;
+
+ tleft = GST_FRAMES_TO_CLOCK_TIME
+ (gst_adapter_available (enc->adapter) / 2, AUDIO_SAMPLE_RATE);
+ diff =
+ GST_CLOCK_DIFF (enc->next_ts + tleft, GST_BUFFER_TIMESTAMP (buf));
+ limit = GST_SECOND / AUDIO_SAMPLE_RATE / 2;
+ /* try for a perfect stream if possible, do not act on rounding errors */
+ if (diff > limit || diff < -limit) {
+ enc->next_ts = GST_BUFFER_TIMESTAMP (buf);
+ if (enc->next_ts > tleft)
+ enc->next_ts -= tleft;
+ GST_LOG_OBJECT (enc->element, "marking discont based on timestamps");
+ discont = TRUE;
+ }
+ } else
+ enc->next_ts = GST_BUFFER_TIMESTAMP (buf);
+ }
+
+ gst_adapter_push (enc->adapter, buf);
+ buf = NULL;
+ }
+
+ av = gst_adapter_available (enc->adapter);
+ if (G_UNLIKELY (av < RAW_FRAME_SIZE))
+ goto done;
+
+ data = gst_adapter_peek (enc->adapter, av);
+ obuf = gst_buffer_new_and_alloc (av / RAW_FRAME_SIZE * CODEC_FRAME_SIZE);
+ odata = GST_BUFFER_DATA (obuf);
+ osize = 0;
+ flush = 0;
+
+ while (TRUE) {
+ gint esize;
+#ifdef CN_PAD
+ GstDtxDecision dtx;
+
+ /* safe default to start with, should get set */
+ dtx = GST_DTX_DECISION_VOICE;
+ esize = codec_get_data (enc->element, data + flush, odata, &dtx);
+#else
+ esize = codec_get_data (enc->element, data + flush, odata, NULL);
+#endif
+
+ if (G_UNLIKELY (esize < 0))
+ goto encode_failed;
+
+#ifdef CN_PAD
+ /* cn in a separate stream */
+ switch (dtx) {
+ case GST_DTX_DECISION_VOICE:
+#endif
+ flush += RAW_FRAME_SIZE;
+ av -= RAW_FRAME_SIZE;
+
+ odata += esize;
+ osize += esize;
+#ifdef CN_PAD
+ break;
+ case GST_DTX_DECISION_SID_UPDATE:
+ GST_LOG_OBJECT (enc->element, "dtx: SID_UPDATE %d", esize);
+ /* if already data before, need to put SID data separately */
+ if (G_UNLIKELY (osize)) {
+ cnbuf = gst_buffer_new_and_alloc (esize);
+ memcpy (GST_BUFFER_DATA (cnbuf), data + osize, esize);
+ } else {
+ cnbuf = obuf;
+ obuf = NULL;
+ }
+ /* and send one or both */
+ goto send;
+ break;
+ case GST_DTX_DECISION_SID_NONE:
+ GST_LOG_OBJECT (enc->element, "dtx: SID_NONE %d", esize);
+ /* maybe send preceding voice, if any */
+ goto send;
+ break;
+ }
+#endif
+
+#ifdef CODEC_FRAME_VARIABLE
+ /* flush output after insufficient data */
+ if (av >= RAW_FRAME_SIZE)
+ continue;
+#else
+ /* ... or some reduced (e.g. silence) frame */
+ if (esize >= CODEC_FRAME_SIZE && av >= RAW_FRAME_SIZE)
+ continue;
+#endif
+
+#ifdef CN_PAD
+ send:
+#endif
+ /* maybe a silent discarded frame */
+ if (G_LIKELY (osize)) {
+ GST_BUFFER_SIZE (obuf) = osize;
+ GST_BUFFER_DURATION (obuf)
+ = FRAME_DURATION * (flush / RAW_FRAME_SIZE);
+ GST_BUFFER_TIMESTAMP (obuf) = enc->next_ts;
+ if (G_UNLIKELY (discont)) {
+ GST_BUFFER_FLAG_SET (obuf, GST_BUFFER_FLAG_DISCONT);
+ discont = FALSE;
+ }
+
+ GST_LOG_OBJECT (enc->element,
+ "pushing buffer of size %d with ts: %" GST_TIME_FORMAT,
+ GST_BUFFER_SIZE (obuf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (obuf)));
+ gst_buffer_set_caps (obuf, GST_PAD_CAPS (srcpad));
+ ret = gst_pad_push (srcpad, obuf);
+ obuf = NULL;
+ } else {
+ ret = GST_FLOW_OK;
+ }
+
+#ifdef CN_PAD
+ /* check for stuff to send on cn pad */
+ if (cnbuf && cnpad) {
+ /* only at most 1 SID update per buffer */
+ GST_BUFFER_SIZE (cnbuf) = esize;
+ GST_BUFFER_DURATION (cnbuf) = FRAME_DURATION;
+ GST_BUFFER_TIMESTAMP (cnbuf) = enc->next_ts;
+
+ GST_LOG_OBJECT (enc->element,
+ "pushing cn buffer of size %d with ts: %" GST_TIME_FORMAT,
+ GST_BUFFER_SIZE (cnbuf),
+ GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (cnbuf)));
+ gst_buffer_set_caps (cnbuf, GST_PAD_CAPS (cnpad));
+ if (G_LIKELY (ret == GST_FLOW_OK)) {
+ ret = gst_pad_push (cnpad, cnbuf);
+ /* cn pad may not be linked */
+ if (G_UNLIKELY (ret == GST_FLOW_NOT_LINKED))
+ ret = GST_FLOW_OK;
+ } else
+ gst_pad_push (cnpad, cnbuf);
+ cnbuf = NULL;
+ } else if (G_UNLIKELY (cnbuf)) {
+ /* should not occur */
+ gst_buffer_unref (cnbuf);
+ cnbuf = NULL;
+ }
+
+ if (dtx != GST_DTX_DECISION_VOICE) {
+ /* still need to count non-voice encoded frame */
+ flush += RAW_FRAME_SIZE;
+ av -= RAW_FRAME_SIZE;
+ }
+#endif /* CN_PAD */
+
+ /* remove used part */
+ gst_adapter_flush (enc->adapter, flush);
+ if (GST_CLOCK_TIME_IS_VALID (enc->next_ts))
+ enc->next_ts += FRAME_DURATION * (flush / RAW_FRAME_SIZE);
+
+ /* end if insufficient left or error */
+ if (av < RAW_FRAME_SIZE || ret != GST_FLOW_OK)
+ break;
+
+ /* allocate new buffer */
+ if (!obuf) {
+ obuf = gst_buffer_new_and_alloc (av / RAW_FRAME_SIZE * CODEC_FRAME_SIZE);
+ odata = GST_BUFFER_DATA (obuf);
+ osize = 0;
+ }
+ /* and prepare to consume again */
+ data = gst_adapter_peek (enc->adapter, av);
+ flush = 0;
+ }
+
+ if (!av) {
+ enc->next_ts = GST_CLOCK_TIME_NONE;
+ }
+
+done:
+#ifdef CN_PAD
+ GST_OBJECT_LOCK (enc->element);
+ if (cnpad)
+ gst_object_unref (cnpad);
+ GST_OBJECT_UNLOCK (enc->element);
+#endif
+
+ return ret;
+
+ /* ERRORS */
+encode_failed:
+ {
+ GST_ELEMENT_ERROR (enc, STREAM, ENCODE, (NULL), (NULL));
+ ret = GST_FLOW_ERROR;
+ gst_buffer_unref (obuf);
+ goto done;
+ }
+}
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_nokia_speech/gstframedaudioenc.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_nokia_speech/gstframedaudioenc.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,68 @@
+/* GStreamer Framed Audio Encoder
+ * Copyright 2009 Collabora Ltd,
+ * Copyright 2009 Nokia Corporation
+ * @author: Mark Nauwelaerts .
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GST_FRAMED_AUDIO_ENC_H__
+#define __GST_FRAMED_AUDIO_ENC_H__
+
+#include
+#include
+
+G_BEGIN_DECLS
+
+typedef struct _GstNokiaFramedAudioEnc GstNokiaFramedAudioEnc;
+typedef struct _GstNokiaFramedAudioEncClass GstNokiaFramedAudioEncClass;
+
+typedef GstNokiaFramedAudioEnc GstFramedAudioEnc;
+typedef GstNokiaFramedAudioEncClass GstFramedAudioEncClass;
+
+struct _GstNokiaFramedAudioEnc
+{
+ /* helper for this element */
+ GstElement *element;
+
+ /* private stuff */
+
+ /* pad with incoming data */
+ GstPad *sinkpad;
+
+ GstAdapter *adapter;
+ GstClockTime next_ts;
+};
+
+typedef enum _GstDtxDecision {
+ GST_DTX_DECISION_VOICE,
+ GST_DTX_DECISION_SID_UPDATE,
+ GST_DTX_DECISION_SID_NONE
+} GstDtxDecision;
+
+void gst_framed_audio_enc_init (GstFramedAudioEnc * enc, GstElement * element,
+ GstDebugCategory * cat);
+void gst_framed_audio_enc_reset (GstFramedAudioEnc * enc);
+void gst_framed_audio_enc_finalize (GstFramedAudioEnc * enc);
+GstPad * gst_framed_audio_enc_request_new_pad (GstFramedAudioEnc * enc,
+ GstPadTemplate * templ, const gchar * req_name, GstPad ** pad_p);
+void gst_framed_audio_enc_release_pad (GstFramedAudioEnc * enc, GstPad * pad,
+ GstPad ** pad_p, void (disable_cn) (GstElement *));
+gboolean gst_framed_audio_enc_sink_event (GstPad * pad, GstEvent * event);
+
+G_END_DECLS
+
+#endif /* __GST_FRAMED_AUDIO_ENC_H__ */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstappu.def
--- a/gst_plugins_base/bwins/libgstappu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstappu.def Wed Mar 24 18:04:17 2010 -0500
@@ -9,26 +9,27 @@
gst_app_sink_get_type @ 8 NONAME
gst_app_sink_is_eos @ 9 NONAME
gst_app_sink_pull_buffer @ 10 NONAME
- gst_app_sink_pull_preroll @ 11 NONAME
- gst_app_sink_set_callbacks @ 12 NONAME
- gst_app_sink_set_caps @ 13 NONAME
- gst_app_sink_set_drop @ 14 NONAME
- gst_app_sink_set_emit_signals @ 15 NONAME
- gst_app_sink_set_max_buffers @ 16 NONAME
- gst_app_src_end_of_stream @ 17 NONAME
- gst_app_src_get_caps @ 18 NONAME
- gst_app_src_get_emit_signals @ 19 NONAME
- gst_app_src_get_latency @ 20 NONAME
- gst_app_src_get_max_bytes @ 21 NONAME
- gst_app_src_get_size @ 22 NONAME
- gst_app_src_get_stream_type @ 23 NONAME
- gst_app_src_get_type @ 24 NONAME
- gst_app_src_push_buffer @ 25 NONAME
- gst_app_src_set_callbacks @ 26 NONAME
- gst_app_src_set_caps @ 27 NONAME
- gst_app_src_set_emit_signals @ 28 NONAME
- gst_app_src_set_latency @ 29 NONAME
- gst_app_src_set_max_bytes @ 30 NONAME
- gst_app_src_set_size @ 31 NONAME
- gst_app_src_set_stream_type @ 32 NONAME
+ gst_app_sink_pull_buffer_list @ 11 NONAME
+ gst_app_sink_pull_preroll @ 12 NONAME
+ gst_app_sink_set_callbacks @ 13 NONAME
+ gst_app_sink_set_caps @ 14 NONAME
+ gst_app_sink_set_drop @ 15 NONAME
+ gst_app_sink_set_emit_signals @ 16 NONAME
+ gst_app_sink_set_max_buffers @ 17 NONAME
+ gst_app_src_end_of_stream @ 18 NONAME
+ gst_app_src_get_caps @ 19 NONAME
+ gst_app_src_get_emit_signals @ 20 NONAME
+ gst_app_src_get_latency @ 21 NONAME
+ gst_app_src_get_max_bytes @ 22 NONAME
+ gst_app_src_get_size @ 23 NONAME
+ gst_app_src_get_stream_type @ 24 NONAME
+ gst_app_src_get_type @ 25 NONAME
+ gst_app_src_push_buffer @ 26 NONAME
+ gst_app_src_set_callbacks @ 27 NONAME
+ gst_app_src_set_caps @ 28 NONAME
+ gst_app_src_set_emit_signals @ 29 NONAME
+ gst_app_src_set_latency @ 30 NONAME
+ gst_app_src_set_max_bytes @ 31 NONAME
+ gst_app_src_set_size @ 32 NONAME
+ gst_app_src_set_stream_type @ 33 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstaudioresampleu.def
--- a/gst_plugins_base/bwins/libgstaudioresampleu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstaudioresampleu.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,52 +1,4 @@
EXPORTS
_GST_PLUGIN_DESC @ 1 NONAME
- audioresample_buffer_new @ 2 NONAME
- audioresample_buffer_new_and_alloc @ 3 NONAME
- audioresample_buffer_new_subbuffer @ 4 NONAME
- audioresample_buffer_new_with_data @ 5 NONAME
- audioresample_buffer_queue_flush @ 6 NONAME
- audioresample_buffer_queue_free @ 7 NONAME
- audioresample_buffer_queue_get_depth @ 8 NONAME
- audioresample_buffer_queue_get_offset @ 9 NONAME
- audioresample_buffer_queue_new @ 10 NONAME
- audioresample_buffer_queue_peek @ 11 NONAME
- audioresample_buffer_queue_pull @ 12 NONAME
- audioresample_buffer_queue_push @ 13 NONAME
- audioresample_buffer_ref @ 14 NONAME
- audioresample_buffer_unref @ 15 NONAME
- functable_calculate @ 16 NONAME
- functable_calculate_multiply @ 17 NONAME
- functable_evaluate @ 18 NONAME
- functable_fir @ 19 NONAME
- functable_fir2 @ 20 NONAME
- functable_free @ 21 NONAME
- functable_func_boxcar @ 22 NONAME
- functable_func_hanning @ 23 NONAME
- functable_func_sinc @ 24 NONAME
- functable_new @ 25 NONAME
- functable_set_length @ 26 NONAME
- functable_set_multiplier @ 27 NONAME
- functable_set_offset @ 28 NONAME
- gst_audioresample_get_type @ 29 NONAME
- resample_add_input_data @ 30 NONAME
- resample_format_size @ 31 NONAME
- resample_free @ 32 NONAME
- resample_get_input_size_for_output @ 33 NONAME
- resample_get_output_data @ 34 NONAME
- resample_get_output_size @ 35 NONAME
- resample_get_output_size_for_input @ 36 NONAME
- resample_init @ 37 NONAME
- resample_input_eos @ 38 NONAME
- resample_input_flush @ 39 NONAME
- resample_input_pushthrough @ 40 NONAME
- resample_new @ 41 NONAME
- resample_scale_chunk @ 42 NONAME
- resample_scale_functable @ 43 NONAME
- resample_scale_ref @ 44 NONAME
- resample_set_filter_length @ 45 NONAME
- resample_set_format @ 46 NONAME
- resample_set_input_rate @ 47 NONAME
- resample_set_method @ 48 NONAME
- resample_set_n_channels @ 49 NONAME
- resample_set_output_rate @ 50 NONAME
+ gst_audio_resample_get_type @ 2 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstaudiou.def
--- a/gst_plugins_base/bwins/libgstaudiou.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstaudiou.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,57 +1,72 @@
EXPORTS
gst_audio_buffer_clip @ 1 NONAME
gst_audio_channel_position_get_type @ 2 NONAME
- gst_audio_clock_get_type @ 3 NONAME
- gst_audio_clock_new @ 4 NONAME
- gst_audio_default_registry_mixer_filter @ 5 NONAME
- gst_audio_duration_from_pad_buffer @ 6 NONAME
- gst_audio_filter_class_add_pad_templates @ 7 NONAME
- gst_audio_filter_get_type @ 8 NONAME
- gst_audio_fixate_channel_positions @ 9 NONAME
- gst_audio_frame_byte_size @ 10 NONAME
- gst_audio_frame_length @ 11 NONAME
- gst_audio_get_channel_positions @ 12 NONAME
- gst_audio_is_buffer_framed @ 13 NONAME
- gst_audio_set_caps_channel_positions_list @ 14 NONAME
- gst_audio_set_channel_positions @ 15 NONAME
- gst_audio_set_structure_channel_positions_list @ 16 NONAME
- gst_audio_sink_get_type @ 17 NONAME
- gst_audio_src_get_type @ 18 NONAME
- gst_audio_structure_set_int @ 19 NONAME
- gst_base_audio_sink_create_ringbuffer @ 20 NONAME
- gst_base_audio_sink_get_provide_clock @ 21 NONAME
- gst_base_audio_sink_get_slave_method @ 22 NONAME
- gst_base_audio_sink_get_type @ 23 NONAME
- gst_base_audio_sink_set_provide_clock @ 24 NONAME
- gst_base_audio_sink_set_slave_method @ 25 NONAME
- gst_base_audio_src_create_ringbuffer @ 26 NONAME
- gst_base_audio_src_get_provide_clock @ 27 NONAME
- gst_base_audio_src_get_type @ 28 NONAME
- gst_base_audio_src_set_provide_clock @ 29 NONAME
- gst_ring_buffer_acquire @ 30 NONAME
- gst_ring_buffer_advance @ 31 NONAME
- gst_ring_buffer_clear @ 32 NONAME
- gst_ring_buffer_clear_all @ 33 NONAME
- gst_ring_buffer_close_device @ 34 NONAME
- gst_ring_buffer_commit @ 35 NONAME
- gst_ring_buffer_commit_full @ 36 NONAME
- gst_ring_buffer_debug_spec_buff @ 37 NONAME
- gst_ring_buffer_debug_spec_caps @ 38 NONAME
- gst_ring_buffer_delay @ 39 NONAME
- gst_ring_buffer_device_is_open @ 40 NONAME
- gst_ring_buffer_get_type @ 41 NONAME
- gst_ring_buffer_is_acquired @ 42 NONAME
- gst_ring_buffer_may_start @ 43 NONAME
- gst_ring_buffer_open_device @ 44 NONAME
- gst_ring_buffer_parse_caps @ 45 NONAME
- gst_ring_buffer_pause @ 46 NONAME
- gst_ring_buffer_prepare_read @ 47 NONAME
- gst_ring_buffer_read @ 48 NONAME
- gst_ring_buffer_release @ 49 NONAME
- gst_ring_buffer_samples_done @ 50 NONAME
- gst_ring_buffer_set_callback @ 51 NONAME
- gst_ring_buffer_set_flushing @ 52 NONAME
- gst_ring_buffer_set_sample @ 53 NONAME
- gst_ring_buffer_start @ 54 NONAME
- gst_ring_buffer_stop @ 55 NONAME
+ gst_audio_check_channel_positions @ 3 NONAME
+ gst_audio_clock_adjust @ 4 NONAME
+ gst_audio_clock_get_time @ 5 NONAME
+ gst_audio_clock_get_type @ 6 NONAME
+ gst_audio_clock_new @ 7 NONAME
+ gst_audio_clock_reset @ 8 NONAME
+ gst_audio_default_registry_mixer_filter @ 9 NONAME
+ gst_audio_duration_from_pad_buffer @ 10 NONAME
+ gst_audio_filter_class_add_pad_templates @ 11 NONAME
+ gst_audio_filter_get_type @ 12 NONAME
+ gst_audio_fixate_channel_positions @ 13 NONAME
+ gst_audio_frame_byte_size @ 14 NONAME
+ gst_audio_frame_length @ 15 NONAME
+ gst_audio_get_channel_positions @ 16 NONAME
+ gst_audio_is_buffer_framed @ 17 NONAME
+ gst_audio_set_caps_channel_positions_list @ 18 NONAME
+ gst_audio_set_channel_positions @ 19 NONAME
+ gst_audio_set_structure_channel_positions_list @ 20 NONAME
+ gst_audio_sink_get_type @ 21 NONAME
+ gst_audio_src_get_type @ 22 NONAME
+ gst_audio_structure_set_int @ 23 NONAME
+ gst_base_audio_sink_create_ringbuffer @ 24 NONAME
+ gst_base_audio_sink_get_provide_clock @ 25 NONAME
+ gst_base_audio_sink_get_slave_method @ 26 NONAME
+ gst_base_audio_sink_get_type @ 27 NONAME
+ gst_base_audio_sink_set_provide_clock @ 28 NONAME
+ gst_base_audio_sink_set_slave_method @ 29 NONAME
+ gst_base_audio_sink_slave_method_get_type @ 30 NONAME
+ gst_base_audio_src_create_ringbuffer @ 31 NONAME
+ gst_base_audio_src_get_provide_clock @ 32 NONAME
+ gst_base_audio_src_get_slave_method @ 33 NONAME
+ gst_base_audio_src_get_type @ 34 NONAME
+ gst_base_audio_src_set_provide_clock @ 35 NONAME
+ gst_base_audio_src_set_slave_method @ 36 NONAME
+ gst_base_audio_src_slave_method_get_type @ 37 NONAME
+ gst_buffer_format_get_type @ 38 NONAME
+ gst_buffer_format_type_get_type @ 39 NONAME
+ gst_ring_buffer_acquire @ 40 NONAME
+ gst_ring_buffer_activate @ 41 NONAME
+ gst_ring_buffer_advance @ 42 NONAME
+ gst_ring_buffer_clear @ 43 NONAME
+ gst_ring_buffer_clear_all @ 44 NONAME
+ gst_ring_buffer_close_device @ 45 NONAME
+ gst_ring_buffer_commit @ 46 NONAME
+ gst_ring_buffer_commit_full @ 47 NONAME
+ gst_ring_buffer_convert @ 48 NONAME
+ gst_ring_buffer_debug_spec_buff @ 49 NONAME
+ gst_ring_buffer_debug_spec_caps @ 50 NONAME
+ gst_ring_buffer_delay @ 51 NONAME
+ gst_ring_buffer_device_is_open @ 52 NONAME
+ gst_ring_buffer_get_type @ 53 NONAME
+ gst_ring_buffer_is_acquired @ 54 NONAME
+ gst_ring_buffer_is_active @ 55 NONAME
+ gst_ring_buffer_may_start @ 56 NONAME
+ gst_ring_buffer_open_device @ 57 NONAME
+ gst_ring_buffer_parse_caps @ 58 NONAME
+ gst_ring_buffer_pause @ 59 NONAME
+ gst_ring_buffer_prepare_read @ 60 NONAME
+ gst_ring_buffer_read @ 61 NONAME
+ gst_ring_buffer_release @ 62 NONAME
+ gst_ring_buffer_samples_done @ 63 NONAME
+ gst_ring_buffer_seg_state_get_type @ 64 NONAME
+ gst_ring_buffer_set_callback @ 65 NONAME
+ gst_ring_buffer_set_flushing @ 66 NONAME
+ gst_ring_buffer_set_sample @ 67 NONAME
+ gst_ring_buffer_start @ 68 NONAME
+ gst_ring_buffer_state_get_type @ 69 NONAME
+ gst_ring_buffer_stop @ 70 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstcddau.def
--- a/gst_plugins_base/bwins/libgstcddau.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstcddau.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,5 +1,5 @@
EXPORTS
- __gst_cdda_rfc822_binary @ 1 NONAME
- gst_cdda_base_src_add_track @ 2 NONAME
- gst_cdda_base_src_get_type @ 3 NONAME
+ gst_cdda_base_src_add_track @ 1 NONAME
+ gst_cdda_base_src_get_type @ 2 NONAME
+ gst_cdda_base_src_mode_get_type @ 3 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstdecodebin2u.def
--- a/gst_plugins_base/bwins/libgstdecodebin2u.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstdecodebin2u.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,18 +1,21 @@
EXPORTS
_GST_PLUGIN_DESC @ 1 NONAME
gst_autoplug_select_result_get_type @ 2 NONAME
- gst_factory_list_debug @ 3 NONAME
- gst_factory_list_filter @ 4 NONAME
- gst_factory_list_get_elements @ 5 NONAME
- gst_factory_list_is_type @ 6 NONAME
- gst_play_flags_get_type @ 7 NONAME
- gst_play_marshal_BOOLEAN__OBJECT_OBJECT @ 8 NONAME
- gst_play_marshal_BOOLEAN__OBJECT_OBJECT_OBJECT @ 9 NONAME
- gst_play_marshal_BOXED__INT @ 10 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT @ 11 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT_BOXED @ 12 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 13 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_OBJECT @ 14 NONAME
- gst_play_marshal_OBJECT__BOXED @ 15 NONAME
- gst_play_marshal_VOID__OBJECT_BOOLEAN @ 16 NONAME
+ gst_decode_bin_plugin_init @ 3 NONAME
+ gst_decode_pad_get_type @ 4 NONAME
+ gst_factory_list_debug @ 5 NONAME
+ gst_factory_list_filter @ 6 NONAME
+ gst_factory_list_get_elements @ 7 NONAME
+ gst_factory_list_is_type @ 8 NONAME
+ gst_play_flags_get_type @ 9 NONAME
+ gst_play_marshal_BOOLEAN__OBJECT_BOXED @ 10 NONAME
+ gst_play_marshal_BOOLEAN__OBJECT_OBJECT_OBJECT @ 11 NONAME
+ gst_play_marshal_BOXED__INT @ 12 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED @ 13 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED_BOXED @ 14 NONAME
+ gst_play_marshal_ENUM__OBJECT_BOXED_OBJECT @ 15 NONAME
+ gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 16 NONAME
+ gst_play_marshal_OBJECT__BOXED @ 17 NONAME
+ gst_play_marshal_OBJECT__INT @ 18 NONAME
+ gst_play_marshal_VOID__OBJECT_BOOLEAN @ 19 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstdecodebinu.def
--- a/gst_plugins_base/bwins/libgstdecodebinu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstdecodebinu.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,12 +1,13 @@
EXPORTS
_GST_PLUGIN_DESC @ 1 NONAME
- gst_play_marshal_BOOLEAN__OBJECT_OBJECT @ 2 NONAME
+ gst_play_marshal_BOOLEAN__OBJECT_BOXED @ 2 NONAME
gst_play_marshal_BOOLEAN__OBJECT_OBJECT_OBJECT @ 3 NONAME
gst_play_marshal_BOXED__INT @ 4 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT @ 5 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT_BOXED @ 6 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 7 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_OBJECT @ 8 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED @ 5 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED_BOXED @ 6 NONAME
+ gst_play_marshal_ENUM__OBJECT_BOXED_OBJECT @ 7 NONAME
+ gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 8 NONAME
gst_play_marshal_OBJECT__BOXED @ 9 NONAME
- gst_play_marshal_VOID__OBJECT_BOOLEAN @ 10 NONAME
+ gst_play_marshal_OBJECT__INT @ 10 NONAME
+ gst_play_marshal_VOID__OBJECT_BOOLEAN @ 11 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstffmpegcolorspaceu.def
--- a/gst_plugins_base/bwins/libgstffmpegcolorspaceu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstffmpegcolorspaceu.def Wed Mar 24 18:04:17 2010 -0500
@@ -5,25 +5,25 @@
av_free_static @ 4 NONAME
av_freep @ 5 NONAME
av_malloc @ 6 NONAME
- av_mallocz_static @ 7 NONAME
- av_realloc @ 8 NONAME
- av_strdup @ 9 NONAME
- avcodec_alloc_context @ 10 NONAME
- avcodec_find_best_pix_fmt @ 11 NONAME
- avcodec_get_chroma_sub_sample @ 12 NONAME
- avcodec_get_context_defaults @ 13 NONAME
- avcodec_get_pix_fmt @ 14 NONAME
- avcodec_get_pix_fmt_loss @ 15 NONAME
- avcodec_get_pix_fmt_name @ 16 NONAME
- avcodec_init @ 17 NONAME
- dsputil_static_init @ 18 NONAME
- get_pix_fmt_info @ 19 NONAME
- gst_ffmpegcolorspace_register @ 20 NONAME
- gst_ffmpegcsp_avpicture_fill @ 21 NONAME
- gst_ffmpegcsp_caps_with_codectype @ 22 NONAME
- gst_ffmpegcsp_codectype_to_caps @ 23 NONAME
- img_convert @ 24 NONAME
- img_get_alpha_info @ 25 NONAME
- av_mallocz @ 26 NONAME
- avpicture_get_size @ 27 NONAME
+ av_mallocz @ 7 NONAME
+ av_mallocz_static @ 8 NONAME
+ av_realloc @ 9 NONAME
+ av_strdup @ 10 NONAME
+ avcodec_alloc_context @ 11 NONAME
+ avcodec_find_best_pix_fmt @ 12 NONAME
+ avcodec_get_chroma_sub_sample @ 13 NONAME
+ avcodec_get_context_defaults @ 14 NONAME
+ avcodec_get_pix_fmt @ 15 NONAME
+ avcodec_get_pix_fmt_loss @ 16 NONAME
+ avcodec_get_pix_fmt_name @ 17 NONAME
+ avcodec_init @ 18 NONAME
+ avpicture_get_size @ 19 NONAME
+ dsputil_static_init @ 20 NONAME
+ get_pix_fmt_info @ 21 NONAME
+ gst_ffmpegcolorspace_register @ 22 NONAME
+ gst_ffmpegcsp_avpicture_fill @ 23 NONAME
+ gst_ffmpegcsp_caps_with_codectype @ 24 NONAME
+ gst_ffmpegcsp_codectype_to_caps @ 25 NONAME
+ img_convert @ 26 NONAME
+ img_get_alpha_info @ 27 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstinterfacesu.def
--- a/gst_plugins_base/bwins/libgstinterfacesu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstinterfacesu.def Wed Mar 24 18:04:17 2010 -0500
@@ -39,53 +39,80 @@
gst_mixer_track_get_type @ 38 NONAME
gst_mixer_type_get_type @ 39 NONAME
gst_mixer_volume_changed @ 40 NONAME
- gst_navigation_get_type @ 41 NONAME
- gst_navigation_send_event @ 42 NONAME
- gst_navigation_send_key_event @ 43 NONAME
- gst_navigation_send_mouse_event @ 44 NONAME
- gst_property_probe_get_properties @ 45 NONAME
- gst_property_probe_get_property @ 46 NONAME
- gst_property_probe_get_type @ 47 NONAME
- gst_property_probe_get_values @ 48 NONAME
- gst_property_probe_get_values_name @ 49 NONAME
- gst_property_probe_needs_probe @ 50 NONAME
- gst_property_probe_needs_probe_name @ 51 NONAME
- gst_property_probe_probe_and_get_values @ 52 NONAME
- gst_property_probe_probe_and_get_values_name @ 53 NONAME
- gst_property_probe_probe_property @ 54 NONAME
- gst_property_probe_probe_property_name @ 55 NONAME
- gst_tuner_channel_changed @ 56 NONAME
- gst_tuner_channel_flags_get_type @ 57 NONAME
- gst_tuner_channel_get_type @ 58 NONAME
- gst_tuner_find_channel_by_name @ 59 NONAME
- gst_tuner_find_norm_by_name @ 60 NONAME
- gst_tuner_frequency_changed @ 61 NONAME
- gst_tuner_get_channel @ 62 NONAME
- gst_tuner_get_frequency @ 63 NONAME
- gst_tuner_get_norm @ 64 NONAME
- gst_tuner_get_type @ 65 NONAME
- gst_tuner_list_channels @ 66 NONAME
- gst_tuner_list_norms @ 67 NONAME
- gst_tuner_norm_changed @ 68 NONAME
- gst_tuner_norm_get_type @ 69 NONAME
- gst_tuner_set_channel @ 70 NONAME
- gst_tuner_set_frequency @ 71 NONAME
- gst_tuner_set_norm @ 72 NONAME
- gst_tuner_signal_changed @ 73 NONAME
- gst_tuner_signal_strength @ 74 NONAME
- gst_video_orientation_get_hcenter @ 75 NONAME
- gst_video_orientation_get_hflip @ 76 NONAME
- gst_video_orientation_get_type @ 77 NONAME
- gst_video_orientation_get_vcenter @ 78 NONAME
- gst_video_orientation_get_vflip @ 79 NONAME
- gst_video_orientation_set_hcenter @ 80 NONAME
- gst_video_orientation_set_hflip @ 81 NONAME
- gst_video_orientation_set_vcenter @ 82 NONAME
- gst_video_orientation_set_vflip @ 83 NONAME
- gst_x_overlay_expose @ 84 NONAME
- gst_x_overlay_get_type @ 85 NONAME
- gst_x_overlay_got_xwindow_id @ 86 NONAME
- gst_x_overlay_handle_events @ 87 NONAME
- gst_x_overlay_prepare_xwindow_id @ 88 NONAME
- gst_x_overlay_set_xwindow_id @ 89 NONAME
+ gst_navigation_command_get_type @ 41 NONAME
+ gst_navigation_event_get_type @ 42 NONAME
+ gst_navigation_event_parse_command @ 43 NONAME
+ gst_navigation_event_parse_key_event @ 44 NONAME
+ gst_navigation_event_parse_mouse_button_event @ 45 NONAME
+ gst_navigation_event_parse_mouse_move_event @ 46 NONAME
+ gst_navigation_event_type_get_type @ 47 NONAME
+ gst_navigation_get_type @ 48 NONAME
+ gst_navigation_message_get_type @ 49 NONAME
+ gst_navigation_message_new_angles_changed @ 50 NONAME
+ gst_navigation_message_new_commands_changed @ 51 NONAME
+ gst_navigation_message_new_mouse_over @ 52 NONAME
+ gst_navigation_message_parse_angles_changed @ 53 NONAME
+ gst_navigation_message_parse_mouse_over @ 54 NONAME
+ gst_navigation_message_type_get_type @ 55 NONAME
+ gst_navigation_query_get_type @ 56 NONAME
+ gst_navigation_query_new_angles @ 57 NONAME
+ gst_navigation_query_new_commands @ 58 NONAME
+ gst_navigation_query_parse_angles @ 59 NONAME
+ gst_navigation_query_parse_commands_length @ 60 NONAME
+ gst_navigation_query_parse_commands_nth @ 61 NONAME
+ gst_navigation_query_set_angles @ 62 NONAME
+ gst_navigation_query_set_commands @ 63 NONAME
+ gst_navigation_query_set_commandsv @ 64 NONAME
+ gst_navigation_query_type_get_type @ 65 NONAME
+ gst_navigation_send_command @ 66 NONAME
+ gst_navigation_send_event @ 67 NONAME
+ gst_navigation_send_key_event @ 68 NONAME
+ gst_navigation_send_mouse_event @ 69 NONAME
+ gst_property_probe_get_properties @ 70 NONAME
+ gst_property_probe_get_property @ 71 NONAME
+ gst_property_probe_get_type @ 72 NONAME
+ gst_property_probe_get_values @ 73 NONAME
+ gst_property_probe_get_values_name @ 74 NONAME
+ gst_property_probe_needs_probe @ 75 NONAME
+ gst_property_probe_needs_probe_name @ 76 NONAME
+ gst_property_probe_probe_and_get_values @ 77 NONAME
+ gst_property_probe_probe_and_get_values_name @ 78 NONAME
+ gst_property_probe_probe_property @ 79 NONAME
+ gst_property_probe_probe_property_name @ 80 NONAME
+ gst_tuner_channel_changed @ 81 NONAME
+ gst_tuner_channel_flags_get_type @ 82 NONAME
+ gst_tuner_channel_get_type @ 83 NONAME
+ gst_tuner_find_channel_by_name @ 84 NONAME
+ gst_tuner_find_norm_by_name @ 85 NONAME
+ gst_tuner_frequency_changed @ 86 NONAME
+ gst_tuner_get_channel @ 87 NONAME
+ gst_tuner_get_frequency @ 88 NONAME
+ gst_tuner_get_norm @ 89 NONAME
+ gst_tuner_get_type @ 90 NONAME
+ gst_tuner_list_channels @ 91 NONAME
+ gst_tuner_list_norms @ 92 NONAME
+ gst_tuner_norm_changed @ 93 NONAME
+ gst_tuner_norm_get_type @ 94 NONAME
+ gst_tuner_set_channel @ 95 NONAME
+ gst_tuner_set_frequency @ 96 NONAME
+ gst_tuner_set_norm @ 97 NONAME
+ gst_tuner_signal_changed @ 98 NONAME
+ gst_tuner_signal_strength @ 99 NONAME
+ gst_video_orientation_get_hcenter @ 100 NONAME
+ gst_video_orientation_get_hflip @ 101 NONAME
+ gst_video_orientation_get_type @ 102 NONAME
+ gst_video_orientation_get_vcenter @ 103 NONAME
+ gst_video_orientation_get_vflip @ 104 NONAME
+ gst_video_orientation_set_hcenter @ 105 NONAME
+ gst_video_orientation_set_hflip @ 106 NONAME
+ gst_video_orientation_set_vcenter @ 107 NONAME
+ gst_video_orientation_set_vflip @ 108 NONAME
+ gst_x_overlay_expose @ 109 NONAME
+ gst_x_overlay_get_type @ 110 NONAME
+ gst_x_overlay_got_xwindow_id @ 111 NONAME
+ gst_x_overlay_handle_events @ 112 NONAME
+ gst_x_overlay_prepare_xwindow_id @ 113 NONAME
+ gst_x_overlay_set_xwindow_id @ 114 NONAME
+ gst_color_balance_get_balance_type @ 115 NONAME
+ gst_mixer_get_mixer_type @ 116 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstnetbufferu.def
--- a/gst_plugins_base/bwins/libgstnetbufferu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstnetbufferu.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,10 +1,13 @@
EXPORTS
gst_netaddress_equal @ 1 NONAME
- gst_netaddress_get_ip4_address @ 2 NONAME
- gst_netaddress_get_ip6_address @ 3 NONAME
- gst_netaddress_get_net_type @ 4 NONAME
- gst_netaddress_set_ip4_address @ 5 NONAME
- gst_netaddress_set_ip6_address @ 6 NONAME
- gst_netbuffer_get_type @ 7 NONAME
- gst_netbuffer_new @ 8 NONAME
+ gst_netaddress_get_address_bytes @ 2 NONAME
+ gst_netaddress_get_ip4_address @ 3 NONAME
+ gst_netaddress_get_ip6_address @ 4 NONAME
+ gst_netaddress_get_net_type @ 5 NONAME
+ gst_netaddress_set_address_bytes @ 6 NONAME
+ gst_netaddress_set_ip4_address @ 7 NONAME
+ gst_netaddress_set_ip6_address @ 8 NONAME
+ gst_netbuffer_get_type @ 9 NONAME
+ gst_netbuffer_new @ 10 NONAME
+ gst_netaddress_to_string @ 11 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstpbutilsu.def
--- a/gst_plugins_base/bwins/libgstpbutilsu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstpbutilsu.def Wed Mar 24 18:04:17 2010 -0500
@@ -16,18 +16,18 @@
gst_missing_element_message_new @ 15 NONAME
gst_missing_encoder_installer_detail_new @ 16 NONAME
gst_missing_encoder_message_new @ 17 NONAME
- gst_missing_plugin_message_get_installer_detail @ 18 NONAME
- gst_missing_uri_sink_installer_detail_new @ 19 NONAME
- gst_missing_uri_sink_message_new @ 20 NONAME
- gst_missing_uri_source_installer_detail_new @ 21 NONAME
- gst_missing_uri_source_message_new @ 22 NONAME
- gst_pb_utils_add_codec_description_to_tag_list @ 23 NONAME
- gst_pb_utils_get_codec_description @ 24 NONAME
- gst_pb_utils_get_decoder_description @ 25 NONAME
- gst_pb_utils_get_element_description @ 26 NONAME
- gst_pb_utils_get_encoder_description @ 27 NONAME
- gst_pb_utils_get_sink_description @ 28 NONAME
- gst_pb_utils_get_source_description @ 29 NONAME
- gst_pb_utils_init @ 30 NONAME
- gst_missing_plugin_message_get_description @ 31 NONAME
+ gst_missing_plugin_message_get_description @ 18 NONAME
+ gst_missing_plugin_message_get_installer_detail @ 19 NONAME
+ gst_missing_uri_sink_installer_detail_new @ 20 NONAME
+ gst_missing_uri_sink_message_new @ 21 NONAME
+ gst_missing_uri_source_installer_detail_new @ 22 NONAME
+ gst_missing_uri_source_message_new @ 23 NONAME
+ gst_pb_utils_add_codec_description_to_tag_list @ 24 NONAME
+ gst_pb_utils_get_codec_description @ 25 NONAME
+ gst_pb_utils_get_decoder_description @ 26 NONAME
+ gst_pb_utils_get_element_description @ 27 NONAME
+ gst_pb_utils_get_encoder_description @ 28 NONAME
+ gst_pb_utils_get_sink_description @ 29 NONAME
+ gst_pb_utils_get_source_description @ 30 NONAME
+ gst_pb_utils_init @ 31 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstplaybinu.def
--- a/gst_plugins_base/bwins/libgstplaybinu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstplaybinu.def Wed Mar 24 18:04:17 2010 -0500
@@ -10,32 +10,36 @@
gst_play_bin_plugin_init @ 9 NONAME
gst_play_flags_get_type @ 10 NONAME
gst_play_frame_conv_convert @ 11 NONAME
- gst_play_marshal_BOOLEAN__OBJECT_OBJECT @ 12 NONAME
+ gst_play_marshal_BOOLEAN__OBJECT_BOXED @ 12 NONAME
gst_play_marshal_BOOLEAN__OBJECT_OBJECT_OBJECT @ 13 NONAME
gst_play_marshal_BOXED__INT @ 14 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT @ 15 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT_BOXED @ 16 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 17 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_OBJECT @ 18 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED @ 15 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED_BOXED @ 16 NONAME
+ gst_play_marshal_ENUM__OBJECT_BOXED_OBJECT @ 17 NONAME
+ gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 18 NONAME
gst_play_marshal_OBJECT__BOXED @ 19 NONAME
- gst_play_marshal_VOID__OBJECT_BOOLEAN @ 20 NONAME
- gst_play_sink_get_flags @ 21 NONAME
- gst_play_sink_get_last_frame @ 22 NONAME
- gst_play_sink_get_mute @ 23 NONAME
- gst_play_sink_get_type @ 24 NONAME
- gst_play_sink_get_volume @ 25 NONAME
- gst_play_sink_reconfigure @ 26 NONAME
- gst_play_sink_release_pad @ 27 NONAME
- gst_play_sink_request_pad @ 28 NONAME
- gst_play_sink_set_audio_sink @ 29 NONAME
- gst_play_sink_set_flags @ 30 NONAME
- gst_play_sink_set_mute @ 31 NONAME
- gst_play_sink_set_video_sink @ 32 NONAME
- gst_play_sink_set_vis_plugin @ 33 NONAME
- gst_play_sink_set_volume @ 34 NONAME
- gst_stream_info_get_type @ 35 NONAME
- gst_stream_info_is_mute @ 36 NONAME
- gst_stream_info_new @ 37 NONAME
- gst_stream_info_set_mute @ 38 NONAME
- gst_stream_selector_get_type @ 39 NONAME
+ gst_play_marshal_OBJECT__INT @ 20 NONAME
+ gst_play_marshal_VOID__OBJECT_BOOLEAN @ 21 NONAME
+ gst_play_sink_get_flags @ 22 NONAME
+ gst_play_sink_get_font_desc @ 23 NONAME
+ gst_play_sink_get_last_frame @ 24 NONAME
+ gst_play_sink_get_mute @ 25 NONAME
+ gst_play_sink_get_sink @ 26 NONAME
+ gst_play_sink_get_type @ 27 NONAME
+ gst_play_sink_get_vis_plugin @ 28 NONAME
+ gst_play_sink_get_volume @ 29 NONAME
+ gst_play_sink_reconfigure @ 30 NONAME
+ gst_play_sink_release_pad @ 31 NONAME
+ gst_play_sink_request_pad @ 32 NONAME
+ gst_play_sink_set_flags @ 33 NONAME
+ gst_play_sink_set_font_desc @ 34 NONAME
+ gst_play_sink_set_mute @ 35 NONAME
+ gst_play_sink_set_sink @ 36 NONAME
+ gst_play_sink_set_vis_plugin @ 37 NONAME
+ gst_play_sink_set_volume @ 38 NONAME
+ gst_stream_info_get_type @ 39 NONAME
+ gst_stream_info_is_mute @ 40 NONAME
+ gst_stream_info_new @ 41 NONAME
+ gst_stream_info_set_mute @ 42 NONAME
+ gst_stream_selector_get_type @ 43 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstrtpu.def
--- a/gst_plugins_base/bwins/libgstrtpu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstrtpu.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,19 +1,18 @@
-EXPORTS
- gst_base_rtp_audio_payload_base_init @ 1 NONAME
- gst_base_rtp_audio_payload_get_adapter @ 2 NONAME
- gst_base_rtp_audio_payload_get_type @ 3 NONAME
- gst_base_rtp_audio_payload_push @ 4 NONAME
- gst_base_rtp_audio_payload_set_frame_based @ 5 NONAME
- gst_base_rtp_audio_payload_set_frame_options @ 6 NONAME
- gst_base_rtp_audio_payload_set_sample_based @ 7 NONAME
- gst_base_rtp_audio_payload_set_sample_options @ 8 NONAME
- gst_base_rtp_audio_payload_set_samplebits_options @ 9 NONAME
- gst_base_rtp_depayload_get_type @ 10 NONAME
- gst_base_rtp_depayload_push @ 11 NONAME
- gst_base_rtp_depayload_push_ts @ 12 NONAME
- gst_basertppayload_get_type @ 13 NONAME
- gst_basertppayload_is_filled @ 14 NONAME
- gst_basertppayload_push @ 15 NONAME
+EXPORTS gst_base_rtp_audio_payload_get_adapter @ 1 NONAME
+ gst_base_rtp_audio_payload_get_type @ 2 NONAME
+ gst_base_rtp_audio_payload_push @ 3 NONAME
+ gst_base_rtp_audio_payload_set_frame_based @ 4 NONAME
+ gst_base_rtp_audio_payload_set_frame_options @ 5 NONAME
+ gst_base_rtp_audio_payload_set_sample_based @ 6 NONAME
+ gst_base_rtp_audio_payload_set_sample_options @ 7 NONAME
+ gst_base_rtp_audio_payload_set_samplebits_options @ 8 NONAME
+ gst_base_rtp_depayload_get_type @ 9 NONAME
+ gst_base_rtp_depayload_push @ 10 NONAME
+ gst_base_rtp_depayload_push_ts @ 11 NONAME
+ gst_basertppayload_get_type @ 12 NONAME
+ gst_basertppayload_is_filled @ 13 NONAME
+ gst_basertppayload_push @ 14 NONAME
+ gst_basertppayload_push_list @ 15 NONAME
gst_basertppayload_set_options @ 16 NONAME
gst_basertppayload_set_outcaps @ 17 NONAME
gst_rtcp_buffer_add_packet @ 18 NONAME
@@ -34,72 +33,88 @@
gst_rtcp_packet_bye_get_reason_len @ 33 NONAME
gst_rtcp_packet_bye_get_ssrc_count @ 34 NONAME
gst_rtcp_packet_bye_set_reason @ 35 NONAME
- gst_rtcp_packet_get_count @ 36 NONAME
- gst_rtcp_packet_get_length @ 37 NONAME
- gst_rtcp_packet_get_padding @ 38 NONAME
- gst_rtcp_packet_get_rb @ 39 NONAME
- gst_rtcp_packet_get_rb_count @ 40 NONAME
- gst_rtcp_packet_get_type @ 41 NONAME
- gst_rtcp_packet_remove @ 42 NONAME
- gst_rtcp_packet_rr_get_ssrc @ 43 NONAME
- gst_rtcp_packet_rr_set_ssrc @ 44 NONAME
- gst_rtcp_packet_sdes_add_entry @ 45 NONAME
- gst_rtcp_packet_sdes_add_item @ 46 NONAME
- gst_rtcp_packet_sdes_copy_entry @ 47 NONAME
- gst_rtcp_packet_sdes_first_entry @ 48 NONAME
- gst_rtcp_packet_sdes_first_item @ 49 NONAME
- gst_rtcp_packet_sdes_get_entry @ 50 NONAME
- gst_rtcp_packet_sdes_get_item_count @ 51 NONAME
- gst_rtcp_packet_sdes_get_ssrc @ 52 NONAME
- gst_rtcp_packet_sdes_next_entry @ 53 NONAME
- gst_rtcp_packet_sdes_next_item @ 54 NONAME
- gst_rtcp_packet_set_rb @ 55 NONAME
- gst_rtcp_packet_sr_get_sender_info @ 56 NONAME
- gst_rtcp_packet_sr_set_sender_info @ 57 NONAME
- gst_rtcp_unix_to_ntp @ 58 NONAME
- gst_rtp_buffer_allocate_data @ 59 NONAME
- gst_rtp_buffer_calc_header_len @ 60 NONAME
- gst_rtp_buffer_calc_packet_len @ 61 NONAME
- gst_rtp_buffer_calc_payload_len @ 62 NONAME
- gst_rtp_buffer_compare_seqnum @ 63 NONAME
- gst_rtp_buffer_default_clock_rate @ 64 NONAME
- gst_rtp_buffer_ext_timestamp @ 65 NONAME
- gst_rtp_buffer_get_csrc @ 66 NONAME
- gst_rtp_buffer_get_csrc_count @ 67 NONAME
- gst_rtp_buffer_get_extension @ 68 NONAME
- gst_rtp_buffer_get_extension_data @ 69 NONAME
- gst_rtp_buffer_get_header_len @ 70 NONAME
- gst_rtp_buffer_get_marker @ 71 NONAME
- gst_rtp_buffer_get_packet_len @ 72 NONAME
- gst_rtp_buffer_get_padding @ 73 NONAME
- gst_rtp_buffer_get_payload @ 74 NONAME
- gst_rtp_buffer_get_payload_buffer @ 75 NONAME
- gst_rtp_buffer_get_payload_len @ 76 NONAME
- gst_rtp_buffer_get_payload_subbuffer @ 77 NONAME
- gst_rtp_buffer_get_payload_type @ 78 NONAME
- gst_rtp_buffer_get_seq @ 79 NONAME
- gst_rtp_buffer_get_ssrc @ 80 NONAME
- gst_rtp_buffer_get_timestamp @ 81 NONAME
- gst_rtp_buffer_get_version @ 82 NONAME
- gst_rtp_buffer_new_allocate @ 83 NONAME
- gst_rtp_buffer_new_allocate_len @ 84 NONAME
- gst_rtp_buffer_new_copy_data @ 85 NONAME
- gst_rtp_buffer_new_take_data @ 86 NONAME
- gst_rtp_buffer_pad_to @ 87 NONAME
- gst_rtp_buffer_set_csrc @ 88 NONAME
- gst_rtp_buffer_set_extension @ 89 NONAME
- gst_rtp_buffer_set_extension_data @ 90 NONAME
- gst_rtp_buffer_set_marker @ 91 NONAME
- gst_rtp_buffer_set_packet_len @ 92 NONAME
- gst_rtp_buffer_set_padding @ 93 NONAME
- gst_rtp_buffer_set_payload_type @ 94 NONAME
- gst_rtp_buffer_set_seq @ 95 NONAME
- gst_rtp_buffer_set_ssrc @ 96 NONAME
- gst_rtp_buffer_set_timestamp @ 97 NONAME
- gst_rtp_buffer_set_version @ 98 NONAME
- gst_rtp_buffer_validate @ 99 NONAME
- gst_rtp_buffer_validate_data @ 100 NONAME
- gst_rtp_payload_info_for_name @ 101 NONAME
- gst_rtp_payload_info_for_pt @ 102 NONAME
- gst_rtcp_packet_move_to_next @ 103 NONAME
+ gst_rtcp_packet_fb_get_media_ssrc @ 36 NONAME
+ gst_rtcp_packet_fb_get_sender_ssrc @ 37 NONAME
+ gst_rtcp_packet_fb_get_type @ 38 NONAME
+ gst_rtcp_packet_fb_set_media_ssrc @ 39 NONAME
+ gst_rtcp_packet_fb_set_sender_ssrc @ 40 NONAME
+ gst_rtcp_packet_fb_set_type @ 41 NONAME
+ gst_rtcp_packet_get_count @ 42 NONAME
+ gst_rtcp_packet_get_length @ 43 NONAME
+ gst_rtcp_packet_get_padding @ 44 NONAME
+ gst_rtcp_packet_get_rb @ 45 NONAME
+ gst_rtcp_packet_get_rb_count @ 46 NONAME
+ gst_rtcp_packet_get_type @ 47 NONAME
+ gst_rtcp_packet_move_to_next @ 48 NONAME
+ gst_rtcp_packet_remove @ 49 NONAME
+ gst_rtcp_packet_rr_get_ssrc @ 50 NONAME
+ gst_rtcp_packet_rr_set_ssrc @ 51 NONAME
+ gst_rtcp_packet_sdes_add_entry @ 52 NONAME
+ gst_rtcp_packet_sdes_add_item @ 53 NONAME
+ gst_rtcp_packet_sdes_copy_entry @ 54 NONAME
+ gst_rtcp_packet_sdes_first_entry @ 55 NONAME
+ gst_rtcp_packet_sdes_first_item @ 56 NONAME
+ gst_rtcp_packet_sdes_get_entry @ 57 NONAME
+ gst_rtcp_packet_sdes_get_item_count @ 58 NONAME
+ gst_rtcp_packet_sdes_get_ssrc @ 59 NONAME
+ gst_rtcp_packet_sdes_next_entry @ 60 NONAME
+ gst_rtcp_packet_sdes_next_item @ 61 NONAME
+ gst_rtcp_packet_set_rb @ 62 NONAME
+ gst_rtcp_packet_sr_get_sender_info @ 63 NONAME
+ gst_rtcp_packet_sr_set_sender_info @ 64 NONAME
+ gst_rtcp_unix_to_ntp @ 65 NONAME
+ gst_rtp_buffer_allocate_data @ 66 NONAME
+ gst_rtp_buffer_calc_header_len @ 67 NONAME
+ gst_rtp_buffer_calc_packet_len @ 68 NONAME
+ gst_rtp_buffer_calc_payload_len @ 69 NONAME
+ gst_rtp_buffer_compare_seqnum @ 70 NONAME
+ gst_rtp_buffer_default_clock_rate @ 71 NONAME
+ gst_rtp_buffer_ext_timestamp @ 72 NONAME
+ gst_rtp_buffer_get_csrc @ 73 NONAME
+ gst_rtp_buffer_get_csrc_count @ 74 NONAME
+ gst_rtp_buffer_get_extension @ 75 NONAME
+ gst_rtp_buffer_get_extension_data @ 76 NONAME
+ gst_rtp_buffer_get_header_len @ 77 NONAME
+ gst_rtp_buffer_get_marker @ 78 NONAME
+ gst_rtp_buffer_get_packet_len @ 79 NONAME
+ gst_rtp_buffer_get_padding @ 80 NONAME
+ gst_rtp_buffer_get_payload @ 81 NONAME
+ gst_rtp_buffer_get_payload_buffer @ 82 NONAME
+ gst_rtp_buffer_get_payload_len @ 83 NONAME
+ gst_rtp_buffer_get_payload_subbuffer @ 84 NONAME
+ gst_rtp_buffer_get_payload_type @ 85 NONAME
+ gst_rtp_buffer_get_seq @ 86 NONAME
+ gst_rtp_buffer_get_ssrc @ 87 NONAME
+ gst_rtp_buffer_get_timestamp @ 88 NONAME
+ gst_rtp_buffer_get_version @ 89 NONAME
+ gst_rtp_buffer_list_get_payload_len @ 90 NONAME
+ gst_rtp_buffer_list_get_payload_type @ 91 NONAME
+ gst_rtp_buffer_list_get_seq @ 92 NONAME
+ gst_rtp_buffer_list_get_ssrc @ 93 NONAME
+ gst_rtp_buffer_list_get_timestamp @ 94 NONAME
+ gst_rtp_buffer_list_set_payload_type @ 95 NONAME
+ gst_rtp_buffer_list_set_seq @ 96 NONAME
+ gst_rtp_buffer_list_set_ssrc @ 97 NONAME
+ gst_rtp_buffer_list_set_timestamp @ 98 NONAME
+ gst_rtp_buffer_list_validate @ 99 NONAME
+ gst_rtp_buffer_new_allocate @ 100 NONAME
+ gst_rtp_buffer_new_allocate_len @ 101 NONAME
+ gst_rtp_buffer_new_copy_data @ 102 NONAME
+ gst_rtp_buffer_new_take_data @ 103 NONAME
+ gst_rtp_buffer_pad_to @ 104 NONAME
+ gst_rtp_buffer_set_csrc @ 105 NONAME
+ gst_rtp_buffer_set_extension @ 106 NONAME
+ gst_rtp_buffer_set_extension_data @ 107 NONAME
+ gst_rtp_buffer_set_marker @ 108 NONAME
+ gst_rtp_buffer_set_packet_len @ 109 NONAME
+ gst_rtp_buffer_set_padding @ 110 NONAME
+ gst_rtp_buffer_set_payload_type @ 111 NONAME
+ gst_rtp_buffer_set_seq @ 112 NONAME
+ gst_rtp_buffer_set_ssrc @ 113 NONAME
+ gst_rtp_buffer_set_timestamp @ 114 NONAME
+ gst_rtp_buffer_set_version @ 115 NONAME
+ gst_rtp_buffer_validate @ 116 NONAME
+ gst_rtp_buffer_validate_data @ 117 NONAME
+ gst_rtp_payload_info_for_name @ 118 NONAME
+ gst_rtp_payload_info_for_pt @ 119 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgsttagu.def
--- a/gst_plugins_base/bwins/libgsttagu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgsttagu.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,19 +1,22 @@
EXPORTS
gst_tag_demux_get_type @ 1 NONAME
- gst_tag_freeform_string_to_utf8 @ 2 NONAME
- gst_tag_from_id3_tag @ 3 NONAME
- gst_tag_from_id3_user_tag @ 4 NONAME
- gst_tag_from_vorbis_tag @ 5 NONAME
- gst_tag_id3_genre_count @ 6 NONAME
- gst_tag_id3_genre_get @ 7 NONAME
- gst_tag_image_type_get_type @ 8 NONAME
- gst_tag_list_from_vorbiscomment_buffer @ 9 NONAME
- gst_tag_list_new_from_id3v1 @ 10 NONAME
- gst_tag_list_to_vorbiscomment_buffer @ 11 NONAME
- gst_tag_parse_extended_comment @ 12 NONAME
- gst_tag_register_musicbrainz_tags @ 13 NONAME
- gst_tag_to_id3_tag @ 14 NONAME
- gst_tag_to_vorbis_comments @ 15 NONAME
- gst_tag_to_vorbis_tag @ 16 NONAME
- gst_vorbis_tag_add @ 17 NONAME
+ gst_tag_demux_result_get_type @ 2 NONAME
+ gst_tag_freeform_string_to_utf8 @ 3 NONAME
+ gst_tag_from_id3_tag @ 4 NONAME
+ gst_tag_from_id3_user_tag @ 5 NONAME
+ gst_tag_from_vorbis_tag @ 6 NONAME
+ gst_tag_id3_genre_count @ 7 NONAME
+ gst_tag_id3_genre_get @ 8 NONAME
+ gst_tag_image_data_to_image_buffer @ 9 NONAME
+ gst_tag_image_type_get_type @ 10 NONAME
+ gst_tag_list_add_id3_image @ 11 NONAME
+ gst_tag_list_from_vorbiscomment_buffer @ 12 NONAME
+ gst_tag_list_new_from_id3v1 @ 13 NONAME
+ gst_tag_list_to_vorbiscomment_buffer @ 14 NONAME
+ gst_tag_parse_extended_comment @ 15 NONAME
+ gst_tag_register_musicbrainz_tags @ 16 NONAME
+ gst_tag_to_id3_tag @ 17 NONAME
+ gst_tag_to_vorbis_comments @ 18 NONAME
+ gst_tag_to_vorbis_tag @ 19 NONAME
+ gst_vorbis_tag_add @ 20 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgsttcpu.def
--- a/gst_plugins_base/bwins/libgsttcpu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgsttcpu.def Wed Mar 24 18:04:17 2010 -0500
@@ -15,8 +15,8 @@
gst_tcp_gdp_write_caps @ 14 NONAME
gst_tcp_host_to_ip @ 15 NONAME
gst_tcp_marshal_BOXED__INT @ 16 NONAME
- gst_tcp_marshal_VOID__INT_BOOLEAN_INT_UINT64_INT_UINT64 @ 17 NONAME
- gst_tcp_marshal_VOID__INT_BOXED @ 18 NONAME
+ gst_tcp_marshal_VOID__INT_BOXED @ 17 NONAME
+ gst_tcp_marshal_VOID__INT_ENUM_INT_UINT64_INT_UINT64 @ 18 NONAME
gst_tcp_marshal_VOID__STRING_UINT @ 19 NONAME
gst_tcp_protocol_get_type @ 20 NONAME
gst_tcp_read_buffer @ 21 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstvideoscaleu.def
--- a/gst_plugins_base/bwins/libgstvideoscaleu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstvideoscaleu.def Wed Mar 24 18:04:17 2010 -0500
@@ -2,49 +2,76 @@
_GST_PLUGIN_DESC @ 1 NONAME
gst_video_scale_get_type @ 2 NONAME
vs_4tap_init @ 3 NONAME
- vs_image_scale_4tap_Y @ 4 NONAME
- vs_image_scale_linear_RGB @ 5 NONAME
- vs_image_scale_linear_RGB555 @ 6 NONAME
- vs_image_scale_linear_RGB565 @ 7 NONAME
- vs_image_scale_linear_RGBA @ 8 NONAME
- vs_image_scale_linear_UYVY @ 9 NONAME
- vs_image_scale_linear_Y @ 10 NONAME
- vs_image_scale_linear_YUYV @ 11 NONAME
- vs_image_scale_nearest_RGB @ 12 NONAME
- vs_image_scale_nearest_RGB555 @ 13 NONAME
- vs_image_scale_nearest_RGB565 @ 14 NONAME
- vs_image_scale_nearest_UYVY @ 15 NONAME
- vs_image_scale_nearest_Y @ 16 NONAME
- vs_image_scale_nearest_YUYV @ 17 NONAME
- vs_scanline_downsample_RGB @ 18 NONAME
- vs_scanline_downsample_RGBA @ 19 NONAME
- vs_scanline_downsample_UYVY @ 20 NONAME
- vs_scanline_downsample_Y @ 21 NONAME
- vs_scanline_downsample_YUYV @ 22 NONAME
- vs_scanline_merge_4tap_Y @ 23 NONAME
- vs_scanline_merge_linear_RGB @ 24 NONAME
- vs_scanline_merge_linear_RGB555 @ 25 NONAME
- vs_scanline_merge_linear_RGB565 @ 26 NONAME
- vs_scanline_merge_linear_RGBA @ 27 NONAME
- vs_scanline_merge_linear_UYVY @ 28 NONAME
- vs_scanline_merge_linear_Y @ 29 NONAME
- vs_scanline_merge_linear_YUYV @ 30 NONAME
- vs_scanline_resample_4tap_Y @ 31 NONAME
- vs_scanline_resample_linear_RGB @ 32 NONAME
- vs_scanline_resample_linear_RGB555 @ 33 NONAME
- vs_scanline_resample_linear_RGB565 @ 34 NONAME
- vs_scanline_resample_linear_RGBA @ 35 NONAME
- vs_scanline_resample_linear_UYVY @ 36 NONAME
- vs_scanline_resample_linear_Y @ 37 NONAME
- vs_scanline_resample_linear_YUYV @ 38 NONAME
- vs_scanline_resample_nearest_RGB @ 39 NONAME
- vs_scanline_resample_nearest_RGB555 @ 40 NONAME
- vs_scanline_resample_nearest_RGB565 @ 41 NONAME
- vs_scanline_resample_nearest_RGBA @ 42 NONAME
- vs_scanline_resample_nearest_UYVY @ 43 NONAME
- vs_scanline_resample_nearest_Y @ 44 NONAME
- vs_scanline_resample_nearest_YUYV @ 45 NONAME
- vs_image_scale_nearest_RGBA @ 46 NONAME
- vs_scanline_downsample_RGB555 @ 47 NONAME
- vs_scanline_downsample_RGB565 @ 48 NONAME
+ vs_image_scale_4tap_RGB @ 4 NONAME
+ vs_image_scale_4tap_RGB555 @ 5 NONAME
+ vs_image_scale_4tap_RGB565 @ 6 NONAME
+ vs_image_scale_4tap_RGBA @ 7 NONAME
+ vs_image_scale_4tap_UYVY @ 8 NONAME
+ vs_image_scale_4tap_Y @ 9 NONAME
+ vs_image_scale_4tap_YUYV @ 10 NONAME
+ vs_image_scale_linear_RGB @ 11 NONAME
+ vs_image_scale_linear_RGB555 @ 12 NONAME
+ vs_image_scale_linear_RGB565 @ 13 NONAME
+ vs_image_scale_linear_RGBA @ 14 NONAME
+ vs_image_scale_linear_UYVY @ 15 NONAME
+ vs_image_scale_linear_Y @ 16 NONAME
+ vs_image_scale_linear_YUYV @ 17 NONAME
+ vs_image_scale_nearest_RGB @ 18 NONAME
+ vs_image_scale_nearest_RGB555 @ 19 NONAME
+ vs_image_scale_nearest_RGB565 @ 20 NONAME
+ vs_image_scale_nearest_RGBA @ 21 NONAME
+ vs_image_scale_nearest_UYVY @ 22 NONAME
+ vs_image_scale_nearest_Y @ 23 NONAME
+ vs_image_scale_nearest_YUYV @ 24 NONAME
+ vs_scanline_downsample_RGB @ 25 NONAME
+ vs_scanline_downsample_RGB555 @ 26 NONAME
+ vs_scanline_downsample_RGB565 @ 27 NONAME
+ vs_scanline_downsample_RGBA @ 28 NONAME
+ vs_scanline_downsample_UYVY @ 29 NONAME
+ vs_scanline_downsample_Y @ 30 NONAME
+ vs_scanline_downsample_YUYV @ 31 NONAME
+ vs_scanline_merge_4tap_RGB @ 32 NONAME
+ vs_scanline_merge_4tap_RGB555 @ 33 NONAME
+ vs_scanline_merge_4tap_RGB565 @ 34 NONAME
+ vs_scanline_merge_4tap_RGBA @ 35 NONAME
+ vs_scanline_merge_4tap_UYVY @ 36 NONAME
+ vs_scanline_merge_4tap_Y @ 37 NONAME
+ vs_scanline_merge_4tap_YUYV @ 38 NONAME
+ vs_scanline_merge_linear_RGB @ 39 NONAME
+ vs_scanline_merge_linear_RGB555 @ 40 NONAME
+ vs_scanline_merge_linear_RGB565 @ 41 NONAME
+ vs_scanline_merge_linear_RGBA @ 42 NONAME
+ vs_scanline_merge_linear_UYVY @ 43 NONAME
+ vs_scanline_merge_linear_Y @ 44 NONAME
+ vs_scanline_merge_linear_YUYV @ 45 NONAME
+ vs_scanline_resample_4tap_RGB @ 46 NONAME
+ vs_scanline_resample_4tap_RGB555 @ 47 NONAME
+ vs_scanline_resample_4tap_RGB565 @ 48 NONAME
+ vs_scanline_resample_4tap_RGBA @ 49 NONAME
+ vs_scanline_resample_4tap_UYVY @ 50 NONAME
+ vs_scanline_resample_4tap_Y @ 51 NONAME
+ vs_scanline_resample_4tap_YUYV @ 52 NONAME
+ vs_scanline_resample_linear_RGB @ 53 NONAME
+ vs_scanline_resample_linear_RGB555 @ 54 NONAME
+ vs_scanline_resample_linear_RGB565 @ 55 NONAME
+ vs_scanline_resample_linear_RGBA @ 56 NONAME
+ vs_scanline_resample_linear_UYVY @ 57 NONAME
+ vs_scanline_resample_linear_Y @ 58 NONAME
+ vs_scanline_resample_linear_YUYV @ 59 NONAME
+ vs_scanline_resample_nearest_RGB @ 60 NONAME
+ vs_scanline_resample_nearest_RGB555 @ 61 NONAME
+ vs_scanline_resample_nearest_RGB565 @ 62 NONAME
+ vs_scanline_resample_nearest_RGBA @ 63 NONAME
+ vs_scanline_resample_nearest_UYVY @ 64 NONAME
+ vs_scanline_resample_nearest_Y @ 65 NONAME
+ vs_scanline_resample_nearest_YUYV @ 66 NONAME
+ vs_image_scale_4tap_Y16 @ 67 NONAME
+ vs_image_scale_linear_Y16 @ 68 NONAME
+ vs_image_scale_nearest_Y16 @ 69 NONAME
+ vs_scanline_downsample_Y16 @ 70 NONAME
+ vs_scanline_merge_4tap_Y16 @ 71 NONAME
+ vs_scanline_merge_linear_Y16 @ 72 NONAME
+ vs_scanline_resample_4tap_Y16 @ 73 NONAME
+ vs_scanline_resample_linear_Y16 @ 74 NONAME
+ vs_scanline_resample_nearest_Y16 @ 75 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/libgstvideou.def
--- a/gst_plugins_base/bwins/libgstvideou.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/bwins/libgstvideou.def Wed Mar 24 18:04:17 2010 -0500
@@ -9,16 +9,19 @@
gst_video_format_get_pixel_stride @ 8 NONAME
gst_video_format_get_row_stride @ 9 NONAME
gst_video_format_get_size @ 10 NONAME
- gst_video_format_has_alpha @ 11 NONAME
- gst_video_format_is_rgb @ 12 NONAME
- gst_video_format_is_yuv @ 13 NONAME
- gst_video_format_new_caps @ 14 NONAME
- gst_video_format_parse_caps @ 15 NONAME
- gst_video_format_to_fourcc @ 16 NONAME
- gst_video_frame_rate @ 17 NONAME
- gst_video_get_size @ 18 NONAME
- gst_video_parse_caps_framerate @ 19 NONAME
- gst_video_parse_caps_pixel_aspect_ratio @ 20 NONAME
- gst_video_sink_center_rect @ 21 NONAME
- gst_video_sink_get_type @ 22 NONAME
+ gst_video_format_get_type @ 11 NONAME
+ gst_video_format_has_alpha @ 12 NONAME
+ gst_video_format_is_rgb @ 13 NONAME
+ gst_video_format_is_yuv @ 14 NONAME
+ gst_video_format_new_caps @ 15 NONAME
+ gst_video_format_new_caps_interlaced @ 16 NONAME
+ gst_video_format_parse_caps @ 17 NONAME
+ gst_video_format_parse_caps_interlaced @ 18 NONAME
+ gst_video_format_to_fourcc @ 19 NONAME
+ gst_video_frame_rate @ 20 NONAME
+ gst_video_get_size @ 21 NONAME
+ gst_video_parse_caps_framerate @ 22 NONAME
+ gst_video_parse_caps_pixel_aspect_ratio @ 23 NONAME
+ gst_video_sink_center_rect @ 24 NONAME
+ gst_video_sink_get_type @ 25 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/bwins/liboilu.def
--- a/gst_plugins_base/bwins/liboilu.def Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-EXPORTS
- merge_linear_argb_ref @ 1 NONAME
- oil_class_optimize @ 2 NONAME
- oil_cpu_get_flags @ 3 NONAME
- oil_impl_is_runnable @ 4 NONAME
- oil_merge_linear_argb @ 5 NONAME
- oil_merge_linear_u8 @ 6 NONAME
- oil_resample_linear_argb @ 7 NONAME
- oil_resample_linear_u8 @ 8 NONAME
- oil_scalarmultiply_f32_ns @ 9 NONAME
- oil_splat_u8 @ 10 NONAME
- oil_splat_u8_ns @ 11 NONAME
- resample_linear_argb_ref @ 12 NONAME
- resample_linear_u8_ref @ 13 NONAME
-
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/config.h
--- a/gst_plugins_base/config.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/config.h Wed Mar 24 18:04:17 2010 -0500
@@ -1,6 +1,19 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* The implementation that should be used for integer audio resampling witll
+ be benchmarked at runtime */
+#define AUDIORESAMPLE_FORMAT_AUTO 1
+
+/* The float implementation should be used for integer audio resampling */
+/* #undef AUDIORESAMPLE_FORMAT_FLOAT */
+
+/* The int implementation should be used for integer audio resampling */
+/* #undef AUDIORESAMPLE_FORMAT_INT */
+
/* defined if cdda headers are in a cdda/ directory */
/* #undef CDPARANOIA_HEADERS_IN_DIR */
@@ -52,11 +65,19 @@
#define GST_PACKAGE_ORIGIN "Unknown package origin"
/* Define to enable ALSA (used by alsa). */
-#undef HAVE_ALSA
+/* #undef HAVE_ALSA */
/* Define to enable CDParanoia (used by cdparanoia). */
/* #undef HAVE_CDPARANOIA */
+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYCURRENT */
+
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
+
/* Define if the host CPU is an Alpha */
/* #undef HAVE_CPU_ALPHA */
@@ -139,7 +160,7 @@
#define HAVE_GMTIME_R 1
/* Define to enable GNOME VFS (used by gnomevfs). */
-#undef HAVE_GNOME_VFS
+/* #undef HAVE_GNOME_VFS */
/* Define to enable Video 4 Linux (used by video4linux). */
#undef HAVE_GST_V4L
@@ -153,9 +174,15 @@
/* Define to 1 if you have the `asound' library (-lasound). */
/* #undef HAVE_LIBASOUND */
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
/* Define to 1 if you have the `resolv' library (-lresolv). */
/* #undef HAVE_LIBRESOLV */
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
/* Define to enable libvisual visualization library (used by libvisual). */
/* #undef HAVE_LIBVISUAL */
@@ -175,12 +202,10 @@
#define HAVE_MEMORY_H 1
/* Define to enable Xiph Ogg library (used by ogg). */
-#undef HAVE_OGG
+/* #undef HAVE_OGG */
/* Define to enable Pango font rendering (used by pango). */
-#ifndef __SYMBIAN32__
-#define HAVE_PANGO
-#endif
+/* #undef HAVE_PANGO */
/* defined if the compiler implements __PRETTY_FUNCTION__ */
#define HAVE_PRETTY_FUNCTION 1
@@ -227,15 +252,13 @@
#define HAVE_UNISTD_H 1
/* Define if valgrind should be used */
-#ifndef __SYMBIAN32__
-#define HAVE_VALGRIND 1
-#endif
+/* #undef HAVE_VALGRIND */
/* Define to enable Xiph Vorbis audio codec (used by vorbis). */
-#define HAVE_VORBIS
+/* #undef HAVE_VORBIS */
/* defined if vorbis_synthesis_restart is present */
-#define HAVE_VORBIS_SYNTHESIS_RESTART 1
+/* #undef HAVE_VORBIS_SYNTHESIS_RESTART */
/* Define to 1 if you have the header file. */
/* #undef HAVE_WINSOCK2_H */
@@ -247,13 +270,20 @@
#define HAVE_XSHM
/* Define to enable X11 XVideo extensions (used by xvimagesink). */
-#define HAVE_XVIDEO
+/* #undef HAVE_XVIDEO */
/* the host CPU */
#define HOST_CPU "i686"
+/* directory in which the detected libvisual's plugins are located */
+/* #undef LIBVISUAL_PLUGINSBASEDIR */
+
/* gettext locale dir */
-#define LOCALEDIR "/home/rakhi/openlibs//share/locale"
+#define LOCALEDIR "/home/puneet/puneet_libs/share/locale"
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
/* Define if you have no native hstrerror() function. */
/* #undef NO_HSTRERROR */
@@ -271,13 +301,13 @@
#define PACKAGE_NAME "GStreamer Base Plug-ins"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "GStreamer Base Plug-ins 0.10.19"
+#define PACKAGE_STRING "GStreamer Base Plug-ins 0.10.23"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gst-plugins-base"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.10.19"
+#define PACKAGE_VERSION "0.10.24"
/* directory where plugins are located */
#ifdef __SYMBIAN32__
@@ -314,11 +344,19 @@
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "0.10.19"
+#define VERSION "0.10.24"
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
+#endif
/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstappu.def
--- a/gst_plugins_base/eabi/libgstappu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstappu.def Wed Mar 24 18:04:17 2010 -0500
@@ -9,25 +9,27 @@
gst_app_sink_get_type @ 8 NONAME
gst_app_sink_is_eos @ 9 NONAME
gst_app_sink_pull_buffer @ 10 NONAME
- gst_app_sink_pull_preroll @ 11 NONAME
- gst_app_sink_set_caps @ 12 NONAME
- gst_app_sink_set_drop @ 13 NONAME
- gst_app_sink_set_emit_signals @ 14 NONAME
- gst_app_sink_set_max_buffers @ 15 NONAME
- gst_app_src_end_of_stream @ 16 NONAME
- gst_app_src_get_caps @ 17 NONAME
- gst_app_src_get_emit_signals @ 18 NONAME
- gst_app_src_get_latency @ 19 NONAME
- gst_app_src_get_max_bytes @ 20 NONAME
- gst_app_src_get_size @ 21 NONAME
- gst_app_src_get_stream_type @ 22 NONAME
- gst_app_src_get_type @ 23 NONAME
- gst_app_src_push_buffer @ 24 NONAME
- gst_app_src_set_callbacks @ 25 NONAME
- gst_app_src_set_caps @ 26 NONAME
- gst_app_src_set_emit_signals @ 27 NONAME
- gst_app_src_set_latency @ 28 NONAME
- gst_app_src_set_max_bytes @ 29 NONAME
- gst_app_src_set_size @ 30 NONAME
- gst_app_src_set_stream_type @ 31 NONAME
+ gst_app_sink_pull_buffer_list @ 11 NONAME
+ gst_app_sink_pull_preroll @ 12 NONAME
+ gst_app_sink_set_callbacks @ 13 NONAME
+ gst_app_sink_set_caps @ 14 NONAME
+ gst_app_sink_set_drop @ 15 NONAME
+ gst_app_sink_set_emit_signals @ 16 NONAME
+ gst_app_sink_set_max_buffers @ 17 NONAME
+ gst_app_src_end_of_stream @ 18 NONAME
+ gst_app_src_get_caps @ 19 NONAME
+ gst_app_src_get_emit_signals @ 20 NONAME
+ gst_app_src_get_latency @ 21 NONAME
+ gst_app_src_get_max_bytes @ 22 NONAME
+ gst_app_src_get_size @ 23 NONAME
+ gst_app_src_get_stream_type @ 24 NONAME
+ gst_app_src_get_type @ 25 NONAME
+ gst_app_src_push_buffer @ 26 NONAME
+ gst_app_src_set_callbacks @ 27 NONAME
+ gst_app_src_set_caps @ 28 NONAME
+ gst_app_src_set_emit_signals @ 29 NONAME
+ gst_app_src_set_latency @ 30 NONAME
+ gst_app_src_set_max_bytes @ 31 NONAME
+ gst_app_src_set_size @ 32 NONAME
+ gst_app_src_set_stream_type @ 33 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstaudioresampleu.def
--- a/gst_plugins_base/eabi/libgstaudioresampleu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstaudioresampleu.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,52 +1,4 @@
EXPORTS
_GST_PLUGIN_DESC @ 1 NONAME
- audioresample_buffer_new @ 2 NONAME
- audioresample_buffer_new_and_alloc @ 3 NONAME
- audioresample_buffer_new_subbuffer @ 4 NONAME
- audioresample_buffer_new_with_data @ 5 NONAME
- audioresample_buffer_queue_flush @ 6 NONAME
- audioresample_buffer_queue_free @ 7 NONAME
- audioresample_buffer_queue_get_depth @ 8 NONAME
- audioresample_buffer_queue_get_offset @ 9 NONAME
- audioresample_buffer_queue_new @ 10 NONAME
- audioresample_buffer_queue_peek @ 11 NONAME
- audioresample_buffer_queue_pull @ 12 NONAME
- audioresample_buffer_queue_push @ 13 NONAME
- audioresample_buffer_ref @ 14 NONAME
- audioresample_buffer_unref @ 15 NONAME
- functable_calculate @ 16 NONAME
- functable_calculate_multiply @ 17 NONAME
- functable_evaluate @ 18 NONAME
- functable_fir @ 19 NONAME
- functable_fir2 @ 20 NONAME
- functable_free @ 21 NONAME
- functable_func_boxcar @ 22 NONAME
- functable_func_hanning @ 23 NONAME
- functable_func_sinc @ 24 NONAME
- functable_new @ 25 NONAME
- functable_set_length @ 26 NONAME
- functable_set_multiplier @ 27 NONAME
- functable_set_offset @ 28 NONAME
- gst_audioresample_get_type @ 29 NONAME
- resample_add_input_data @ 30 NONAME
- resample_format_size @ 31 NONAME
- resample_free @ 32 NONAME
- resample_get_input_size_for_output @ 33 NONAME
- resample_get_output_data @ 34 NONAME
- resample_get_output_size @ 35 NONAME
- resample_get_output_size_for_input @ 36 NONAME
- resample_init @ 37 NONAME
- resample_input_eos @ 38 NONAME
- resample_input_flush @ 39 NONAME
- resample_input_pushthrough @ 40 NONAME
- resample_new @ 41 NONAME
- resample_scale_chunk @ 42 NONAME
- resample_scale_functable @ 43 NONAME
- resample_scale_ref @ 44 NONAME
- resample_set_filter_length @ 45 NONAME
- resample_set_format @ 46 NONAME
- resample_set_input_rate @ 47 NONAME
- resample_set_method @ 48 NONAME
- resample_set_n_channels @ 49 NONAME
- resample_set_output_rate @ 50 NONAME
+ gst_audio_resample_get_type @ 2 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstaudiou.def
--- a/gst_plugins_base/eabi/libgstaudiou.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstaudiou.def Wed Mar 24 18:04:17 2010 -0500
@@ -54,4 +54,19 @@
gst_ring_buffer_set_sample @ 53 NONAME
gst_ring_buffer_start @ 54 NONAME
gst_ring_buffer_stop @ 55 NONAME
+ gst_audio_check_channel_positions @ 56 NONAME
+ gst_audio_clock_adjust @ 57 NONAME
+ gst_audio_clock_get_time @ 58 NONAME
+ gst_audio_clock_reset @ 59 NONAME
+ gst_base_audio_sink_slave_method_get_type @ 60 NONAME
+ gst_base_audio_src_get_slave_method @ 61 NONAME
+ gst_base_audio_src_set_slave_method @ 62 NONAME
+ gst_base_audio_src_slave_method_get_type @ 63 NONAME
+ gst_buffer_format_get_type @ 64 NONAME
+ gst_buffer_format_type_get_type @ 65 NONAME
+ gst_ring_buffer_activate @ 66 NONAME
+ gst_ring_buffer_convert @ 67 NONAME
+ gst_ring_buffer_is_active @ 68 NONAME
+ gst_ring_buffer_seg_state_get_type @ 69 NONAME
+ gst_ring_buffer_state_get_type @ 70 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstcddau.def
--- a/gst_plugins_base/eabi/libgstcddau.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstcddau.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,5 +1,5 @@
EXPORTS
- __gst_cdda_rfc822_binary @ 1 NONAME
- gst_cdda_base_src_add_track @ 2 NONAME
- gst_cdda_base_src_get_type @ 3 NONAME
+ gst_cdda_base_src_add_track @ 1 NONAME
+ gst_cdda_base_src_get_type @ 2 NONAME
+ gst_cdda_base_src_mode_get_type @ 3 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstdecodebin2u.def
--- a/gst_plugins_base/eabi/libgstdecodebin2u.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstdecodebin2u.def Wed Mar 24 18:04:17 2010 -0500
@@ -6,13 +6,16 @@
gst_factory_list_get_elements @ 5 NONAME
gst_factory_list_is_type @ 6 NONAME
gst_play_flags_get_type @ 7 NONAME
- gst_play_marshal_BOOLEAN__OBJECT_OBJECT @ 8 NONAME
- gst_play_marshal_BOOLEAN__OBJECT_OBJECT_OBJECT @ 9 NONAME
- gst_play_marshal_BOXED__INT @ 10 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT @ 11 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT_BOXED @ 12 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 13 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_OBJECT @ 14 NONAME
- gst_play_marshal_OBJECT__BOXED @ 15 NONAME
- gst_play_marshal_VOID__OBJECT_BOOLEAN @ 16 NONAME
+ gst_decode_bin_plugin_init @ 8 NONAME
+ gst_decode_pad_get_type @ 9 NONAME
+ gst_play_marshal_BOOLEAN__OBJECT_BOXED @ 10 NONAME
+ gst_play_marshal_BOOLEAN__OBJECT_OBJECT_OBJECT @ 11 NONAME
+ gst_play_marshal_BOXED__INT @ 12 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED @ 13 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED_BOXED @ 14 NONAME
+ gst_play_marshal_ENUM__OBJECT_BOXED_OBJECT @ 15 NONAME
+ gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 16 NONAME
+ gst_play_marshal_OBJECT__BOXED @ 17 NONAME
+ gst_play_marshal_OBJECT__INT @ 18 NONAME
+ gst_play_marshal_VOID__OBJECT_BOOLEAN @ 19 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstdecodebinu.def
--- a/gst_plugins_base/eabi/libgstdecodebinu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstdecodebinu.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,12 +1,13 @@
EXPORTS
_GST_PLUGIN_DESC @ 1 NONAME
- gst_play_marshal_BOOLEAN__OBJECT_OBJECT @ 2 NONAME
+ gst_play_marshal_BOOLEAN__OBJECT_BOXED @ 2 NONAME
gst_play_marshal_BOOLEAN__OBJECT_OBJECT_OBJECT @ 3 NONAME
gst_play_marshal_BOXED__INT @ 4 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT @ 5 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT_BOXED @ 6 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 7 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_OBJECT @ 8 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED @ 5 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED_BOXED @ 6 NONAME
+ gst_play_marshal_ENUM__OBJECT_BOXED_OBJECT @ 7 NONAME
+ gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 8 NONAME
gst_play_marshal_OBJECT__BOXED @ 9 NONAME
- gst_play_marshal_VOID__OBJECT_BOOLEAN @ 10 NONAME
+ gst_play_marshal_OBJECT__INT @ 10 NONAME
+ gst_play_marshal_VOID__OBJECT_BOOLEAN @ 11 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstgdpu.def
--- a/gst_plugins_base/eabi/libgstgdpu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstgdpu.def Wed Mar 24 18:04:17 2010 -0500
@@ -4,4 +4,3 @@
gst_gdp_depay_plugin_init @ 3 NONAME
gst_gdp_pay_get_type @ 4 NONAME
gst_gdp_pay_plugin_init @ 5 NONAME
-
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstinterfacesu.def
--- a/gst_plugins_base/eabi/libgstinterfacesu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstinterfacesu.def Wed Mar 24 18:04:17 2010 -0500
@@ -88,4 +88,31 @@
gst_x_overlay_handle_events @ 87 NONAME
gst_x_overlay_prepare_xwindow_id @ 88 NONAME
gst_x_overlay_set_xwindow_id @ 89 NONAME
+ gst_navigation_command_get_type @ 90 NONAME
+ gst_navigation_event_get_type @ 91 NONAME
+ gst_navigation_event_parse_command @ 92 NONAME
+ gst_navigation_event_parse_key_event @ 93 NONAME
+ gst_navigation_event_parse_mouse_button_event @ 94 NONAME
+ gst_navigation_event_parse_mouse_move_event @ 95 NONAME
+ gst_navigation_event_type_get_type @ 96 NONAME
+ gst_navigation_message_get_type @ 97 NONAME
+ gst_navigation_message_new_angles_changed @ 98 NONAME
+ gst_navigation_message_new_commands_changed @ 99 NONAME
+ gst_navigation_message_new_mouse_over @ 100 NONAME
+ gst_navigation_message_parse_angles_changed @ 101 NONAME
+ gst_navigation_message_parse_mouse_over @ 102 NONAME
+ gst_navigation_message_type_get_type @ 103 NONAME
+ gst_navigation_query_get_type @ 104 NONAME
+ gst_navigation_query_new_angles @ 105 NONAME
+ gst_navigation_query_new_commands @ 106 NONAME
+ gst_navigation_query_parse_angles @ 107 NONAME
+ gst_navigation_query_parse_commands_length @ 108 NONAME
+ gst_navigation_query_parse_commands_nth @ 109 NONAME
+ gst_navigation_query_set_angles @ 110 NONAME
+ gst_navigation_query_set_commands @ 111 NONAME
+ gst_navigation_query_set_commandsv @ 112 NONAME
+ gst_navigation_query_type_get_type @ 113 NONAME
+ gst_navigation_send_command @ 114 NONAME
+ gst_color_balance_get_balance_type @ 115 NONAME
+ gst_mixer_get_mixer_type @ 116 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstnetbufferu.def
--- a/gst_plugins_base/eabi/libgstnetbufferu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstnetbufferu.def Wed Mar 24 18:04:17 2010 -0500
@@ -7,4 +7,7 @@
gst_netaddress_set_ip6_address @ 6 NONAME
gst_netbuffer_get_type @ 7 NONAME
gst_netbuffer_new @ 8 NONAME
+ gst_netaddress_get_address_bytes @ 9 NONAME
+ gst_netaddress_set_address_bytes @ 10 NONAME
+ gst_netaddress_to_string @ 11 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstplaybinu.def
--- a/gst_plugins_base/eabi/libgstplaybinu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstplaybinu.def Wed Mar 24 18:04:17 2010 -0500
@@ -10,32 +10,36 @@
gst_play_bin_plugin_init @ 9 NONAME
gst_play_flags_get_type @ 10 NONAME
gst_play_frame_conv_convert @ 11 NONAME
- gst_play_marshal_BOOLEAN__OBJECT_OBJECT @ 12 NONAME
+ gst_play_marshal_BOOLEAN__OBJECT_BOXED @ 12 NONAME
gst_play_marshal_BOOLEAN__OBJECT_OBJECT_OBJECT @ 13 NONAME
gst_play_marshal_BOXED__INT @ 14 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT @ 15 NONAME
- gst_play_marshal_BOXED__OBJECT_OBJECT_BOXED @ 16 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 17 NONAME
- gst_play_marshal_ENUM__OBJECT_OBJECT_OBJECT @ 18 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED @ 15 NONAME
+ gst_play_marshal_BOXED__OBJECT_BOXED_BOXED @ 16 NONAME
+ gst_play_marshal_ENUM__OBJECT_BOXED_OBJECT @ 17 NONAME
+ gst_play_marshal_ENUM__OBJECT_OBJECT_BOXED @ 18 NONAME
gst_play_marshal_OBJECT__BOXED @ 19 NONAME
- gst_play_marshal_VOID__OBJECT_BOOLEAN @ 20 NONAME
- gst_play_sink_get_flags @ 21 NONAME
- gst_play_sink_get_last_frame @ 22 NONAME
- gst_play_sink_get_mute @ 23 NONAME
- gst_play_sink_get_type @ 24 NONAME
- gst_play_sink_get_volume @ 25 NONAME
- gst_play_sink_reconfigure @ 26 NONAME
- gst_play_sink_release_pad @ 27 NONAME
- gst_play_sink_request_pad @ 28 NONAME
- gst_play_sink_set_audio_sink @ 29 NONAME
- gst_play_sink_set_flags @ 30 NONAME
- gst_play_sink_set_mute @ 31 NONAME
- gst_play_sink_set_video_sink @ 32 NONAME
- gst_play_sink_set_vis_plugin @ 33 NONAME
- gst_play_sink_set_volume @ 34 NONAME
- gst_stream_info_get_type @ 35 NONAME
- gst_stream_info_is_mute @ 36 NONAME
- gst_stream_info_new @ 37 NONAME
- gst_stream_info_set_mute @ 38 NONAME
- gst_stream_selector_get_type @ 39 NONAME
+ gst_play_marshal_OBJECT__INT @ 20 NONAME
+ gst_play_marshal_VOID__OBJECT_BOOLEAN @ 21 NONAME
+ gst_play_sink_get_flags @ 22 NONAME
+ gst_play_sink_get_font_desc @ 23 NONAME
+ gst_play_sink_get_last_frame @ 24 NONAME
+ gst_play_sink_get_mute @ 25 NONAME
+ gst_play_sink_get_sink @ 26 NONAME
+ gst_play_sink_get_type @ 27 NONAME
+ gst_play_sink_get_vis_plugin @ 28 NONAME
+ gst_play_sink_get_volume @ 29 NONAME
+ gst_play_sink_reconfigure @ 30 NONAME
+ gst_play_sink_release_pad @ 31 NONAME
+ gst_play_sink_request_pad @ 32 NONAME
+ gst_play_sink_set_flags @ 33 NONAME
+ gst_play_sink_set_font_desc @ 34 NONAME
+ gst_play_sink_set_mute @ 35 NONAME
+ gst_play_sink_set_sink @ 36 NONAME
+ gst_play_sink_set_vis_plugin @ 37 NONAME
+ gst_play_sink_set_volume @ 38 NONAME
+ gst_stream_info_get_type @ 39 NONAME
+ gst_stream_info_is_mute @ 40 NONAME
+ gst_stream_info_new @ 41 NONAME
+ gst_stream_info_set_mute @ 42 NONAME
+ gst_stream_selector_get_type @ 43 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstrtpu.def
--- a/gst_plugins_base/eabi/libgstrtpu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstrtpu.def Wed Mar 24 18:04:17 2010 -0500
@@ -101,4 +101,21 @@
gst_rtp_buffer_validate_data @ 100 NONAME
gst_rtp_payload_info_for_name @ 101 NONAME
gst_rtp_payload_info_for_pt @ 102 NONAME
+ gst_rtcp_packet_fb_get_media_ssrc @ 103 NONAME
+ gst_rtcp_packet_fb_get_sender_ssrc @ 104 NONAME
+ gst_rtcp_packet_fb_get_type @ 105 NONAME
+ gst_rtcp_packet_fb_set_media_ssrc @ 106 NONAME
+ gst_rtcp_packet_fb_set_sender_ssrc @ 107 NONAME
+ gst_rtcp_packet_fb_set_type @ 108 NONAME
+ gst_basertppayload_push_list @ 109 NONAME
+ gst_rtp_buffer_list_get_payload_len @ 110 NONAME
+ gst_rtp_buffer_list_get_payload_type @ 111 NONAME
+ gst_rtp_buffer_list_get_seq @ 112 NONAME
+ gst_rtp_buffer_list_get_ssrc @ 113 NONAME
+ gst_rtp_buffer_list_get_timestamp @ 114 NONAME
+ gst_rtp_buffer_list_set_payload_type @ 115 NONAME
+ gst_rtp_buffer_list_set_seq @ 116 NONAME
+ gst_rtp_buffer_list_set_timestamp @ 117 NONAME
+ gst_rtp_buffer_list_validate @ 118 NONAME
+ gst_rtp_buffer_list_set_ssrc @ 119 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgsttagu.def
--- a/gst_plugins_base/eabi/libgsttagu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgsttagu.def Wed Mar 24 18:04:17 2010 -0500
@@ -16,4 +16,7 @@
gst_tag_to_vorbis_comments @ 15 NONAME
gst_tag_to_vorbis_tag @ 16 NONAME
gst_vorbis_tag_add @ 17 NONAME
+ gst_tag_demux_result_get_type @ 18 NONAME
+ gst_tag_image_data_to_image_buffer @ 19 NONAME
+ gst_tag_list_add_id3_image @ 20 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgsttcpu.def
--- a/gst_plugins_base/eabi/libgsttcpu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgsttcpu.def Wed Mar 24 18:04:17 2010 -0500
@@ -15,8 +15,8 @@
gst_tcp_gdp_write_caps @ 14 NONAME
gst_tcp_host_to_ip @ 15 NONAME
gst_tcp_marshal_BOXED__INT @ 16 NONAME
- gst_tcp_marshal_VOID__INT_BOOLEAN_INT_UINT64_INT_UINT64 @ 17 NONAME
- gst_tcp_marshal_VOID__INT_BOXED @ 18 NONAME
+ gst_tcp_marshal_VOID__INT_BOXED @ 17 NONAME
+ gst_tcp_marshal_VOID__INT_ENUM_INT_UINT64_INT_UINT64 @ 18 NONAME
gst_tcp_marshal_VOID__STRING_UINT @ 19 NONAME
gst_tcp_protocol_get_type @ 20 NONAME
gst_tcp_read_buffer @ 21 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstvideoscaleu.def
--- a/gst_plugins_base/eabi/libgstvideoscaleu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstvideoscaleu.def Wed Mar 24 18:04:17 2010 -0500
@@ -47,4 +47,31 @@
vs_scanline_resample_nearest_UYVY @ 46 NONAME
vs_scanline_resample_nearest_Y @ 47 NONAME
vs_scanline_resample_nearest_YUYV @ 48 NONAME
+ vs_image_scale_4tap_RGB @ 49 NONAME
+ vs_image_scale_4tap_RGB555 @ 50 NONAME
+ vs_image_scale_4tap_RGB565 @ 51 NONAME
+ vs_image_scale_4tap_RGBA @ 52 NONAME
+ vs_image_scale_4tap_UYVY @ 53 NONAME
+ vs_image_scale_4tap_YUYV @ 54 NONAME
+ vs_scanline_merge_4tap_RGB @ 55 NONAME
+ vs_scanline_merge_4tap_RGB555 @ 56 NONAME
+ vs_scanline_merge_4tap_RGB565 @ 57 NONAME
+ vs_scanline_merge_4tap_RGBA @ 58 NONAME
+ vs_scanline_merge_4tap_UYVY @ 59 NONAME
+ vs_scanline_merge_4tap_YUYV @ 60 NONAME
+ vs_scanline_resample_4tap_RGB @ 61 NONAME
+ vs_scanline_resample_4tap_RGB555 @ 62 NONAME
+ vs_scanline_resample_4tap_RGB565 @ 63 NONAME
+ vs_scanline_resample_4tap_RGBA @ 64 NONAME
+ vs_scanline_resample_4tap_UYVY @ 65 NONAME
+ vs_scanline_resample_4tap_YUYV @ 66 NONAME
+ vs_image_scale_4tap_Y16 @ 67 NONAME
+ vs_image_scale_linear_Y16 @ 68 NONAME
+ vs_image_scale_nearest_Y16 @ 69 NONAME
+ vs_scanline_downsample_Y16 @ 70 NONAME
+ vs_scanline_merge_4tap_Y16 @ 71 NONAME
+ vs_scanline_merge_linear_Y16 @ 72 NONAME
+ vs_scanline_resample_4tap_Y16 @ 73 NONAME
+ vs_scanline_resample_linear_Y16 @ 74 NONAME
+ vs_scanline_resample_nearest_Y16 @ 75 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstvideotestsrcu.def
--- a/gst_plugins_base/eabi/libgstvideotestsrcu.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstvideotestsrcu.def Wed Mar 24 18:04:17 2010 -0500
@@ -1,4 +1,3 @@
EXPORTS
_GST_PLUGIN_DESC @ 1 NONAME
- gst_video_test_src_get_type @ 2 NONAME
-
+ gst_video_test_src_get_type @ 2 NONAME
\ No newline at end of file
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/libgstvideou.def
--- a/gst_plugins_base/eabi/libgstvideou.def Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/eabi/libgstvideou.def Wed Mar 24 18:04:17 2010 -0500
@@ -21,4 +21,7 @@
gst_video_parse_caps_pixel_aspect_ratio @ 20 NONAME
gst_video_sink_center_rect @ 21 NONAME
gst_video_sink_get_type @ 22 NONAME
+ gst_video_format_get_type @ 23 NONAME
+ gst_video_format_new_caps_interlaced @ 24 NONAME
+ gst_video_format_parse_caps_interlaced @ 25 NONAME
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/eabi/liboilu.def
--- a/gst_plugins_base/eabi/liboilu.def Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-EXPORTS
- oil_class_optimize @ 1 NONAME
- oil_cpu_get_flags @ 2 NONAME
- oil_impl_is_runnable @ 3 NONAME
- oil_merge_linear_argb @ 4 NONAME
- oil_merge_linear_u8 @ 5 NONAME
- oil_resample_linear_argb @ 6 NONAME
- oil_resample_linear_u8 @ 7 NONAME
- oil_scalarmultiply_f32_ns @ 8 NONAME
- oil_splat_u8 @ 9 NONAME
- oil_splat_u8_ns @ 10 NONAME
-
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/bld.inf
--- a/gst_plugins_base/group/bld.inf Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/bld.inf Wed Mar 24 18:04:17 2010 -0500
@@ -17,11 +17,6 @@
../gst-libs/gst/interfaces/xoverlay.h /sf/mw/gstreamer/include/gstreamer/gst/interfaces/xoverlay.h
../gst-libs/gst/interfaces/interfaces-enumtypes.h /sf/mw/gstreamer/include/gstreamer/gst/interfaces/interfaces-enumtypes.h
-//app
-../gst-libs/gst/app/gstappbuffer.h /sf/mw/gstreamer/include/gstreamer/gst/app/gstappbuffer.h
-../gst-libs/gst/app/gstappsink.h /sf/mw/gstreamer/include/gstreamer/gst/app/gstappsink.h
-../gst-libs/gst/app/gstappsrc.h /sf/mw/gstreamer/include/gstreamer/gst/app/gstappsrc.h
-
// audio
../gst-libs/gst/audio/audio.h /sf/mw/gstreamer/include/gstreamer/gst/audio/audio.h
../gst-libs/gst/audio/gstaudioclock.h /sf/mw/gstreamer/include/gstreamer/gst/audio/gstaudioclock.h
@@ -33,11 +28,10 @@
../gst-libs/gst/audio/gstringbuffer.h /sf/mw/gstreamer/include/gstreamer/gst/audio/gstringbuffer.h
../gst-libs/gst/audio/mixerutils.h /sf/mw/gstreamer/include/gstreamer/gst/audio/mixerutils.h
../gst-libs/gst/audio/multichannel.h /sf/mw/gstreamer/include/gstreamer/gst/audio/multichannel.h
-../gst-libs/gst/audio/multichannel-enumtypes.h /sf/mw/gstreamer/include/gstreamer/gst/audio/multichannel-enumtypes.h
+../gst-libs/gst/audio/audio-enumtypes.h /sf/mw/gstreamer/include/gstreamer/gst/audio/audio-enumtypes.h
// cdda
-../gst-libs/gst/cdda/base64.h /sf/mw/gstreamer/include/gstreamer/gst/cdda/base64.h
-../gst-libs/gst/cdda/sha1.h /sf/mw/gstreamer/include/gstreamer/gst/cdda/sha1.h
+//../gst-libs/gst/cdda/base64.h /sf/mw/gstreamer/include/gstreamer/gst/cdda/base64.h
../gst-libs/gst/cdda/gstcddabasesrc.h /sf/mw/gstreamer/include/gstreamer/gst/cdda/gstcddabasesrc.h
// floatcast
@@ -48,6 +42,10 @@
../gst-libs/gst/riff/riff-media.h /sf/mw/gstreamer/include/gstreamer/gst/riff/riff-media.h
../gst-libs/gst/riff/riff-read.h /sf/mw/gstreamer/include/gstreamer/gst/riff/riff-read.h
+//app
+../gst-libs/gst/app/gstappbuffer.h /sf/mw/gstreamer/include/gstreamer/gst/app/gstappbuffer.h
+../gst-libs/gst/app/gstappsink.h /sf/mw/gstreamer/include/gstreamer/gst/app/gstappsink.h
+../gst-libs/gst/app/gstappsrc.h /sf/mw/gstreamer/include/gstreamer/gst/app/gstappsrc.h
// rtp
../gst-libs/gst/rtp/gstbasertpdepayload.h /sf/mw/gstreamer/include/gstreamer/gst/rtp/gstbasertpdepayload.h
../gst-libs/gst/rtp/gstbasertppayload.h /sf/mw/gstreamer/include/gstreamer/gst/rtp/gstbasertppayload.h
@@ -67,6 +65,7 @@
../gst-libs/gst/video/gstvideofilter.h /sf/mw/gstreamer/include/gstreamer/gst/video/gstvideofilter.h
../gst-libs/gst/video/gstvideosink.h /sf/mw/gstreamer/include/gstreamer/gst/video/gstvideosink.h
../gst-libs/gst/video/video.h /sf/mw/gstreamer/include/gstreamer/gst/video/video.h
+../gst-libs/gst/video/video-enumtypes.h /sf/mw/gstreamer/include/gstreamer/gst/video/video-enumtypes.h
// adder
../gst/adder/gstadder.h /sf/mw/gstreamer/include/gstreamer/gst/adder/gstadder.h
@@ -78,11 +77,11 @@
../gst/audioconvert/plugin.h /sf/mw/gstreamer/include/gstreamer/gst/audioconvert/plugin.h
// audioresample
-../gst/audioresample/buffer.h /sf/mw/gstreamer/include/gstreamer/gst/audioresample/buffer.h
-../gst/audioresample/debug.h /sf/mw/gstreamer/include/gstreamer/gst/audioresample/debug.h
-../gst/audioresample/functable.h /sf/mw/gstreamer/include/gstreamer/gst/audioresample/functable.h
+//../gst/audioresample/buffer.h /sf/mw/gstreamer/include/gstreamer/gst/audioresample/buffer.h
+//../gst/audioresample/debug.h /sf/mw/gstreamer/include/gstreamer/gst/audioresample/debug.h
+//../gst/audioresample/functable.h /sf/mw/gstreamer/include/gstreamer/gst/audioresample/functable.h
../gst/audioresample/gstaudioresample.h /sf/mw/gstreamer/include/gstreamer/gst/audioresample/gstaudioresample.h
-../gst/audioresample/resample.h /sf/mw/gstreamer/include/gstreamer/gst/audioresample/resample.h
+//../gst/audioresample/resample.h /sf/mw/gstreamer/include/gstreamer/gst/audioresample/resample.h
// audiotestsrc
../gst/audiotestsrc/gstaudiotestsrc.h /sf/mw/gstreamer/include/gstreamer/gst/audiotestsrc/gstaudiotestsrc.h
@@ -139,7 +138,7 @@
../gst/volume/gstvolume.h /sf/mw/gstreamer/include/gstreamer/gst/volume/gstvolume.h
//liboil - Since liboil port is available, No need to use liboil stub.
-../gst/oil/liboil.h /sf/mw/gstreamer/include/gstreamer/gst/liboil.h
+//../gst/oil/liboil.h /sf/mw/gstreamer/include/gstreamer/gst/liboil.h
// fft
../gst-libs/gst/fft/_kiss_fft_guts_f32.h /sf/mw/gstreamer/include/gstreamer/gst/fft/_kiss_fft_guts_f32.h
@@ -189,16 +188,15 @@
gstsubparse.mmp
gsttcp.mmp
gsttypefind.mmp
-gstapp.mmp
gstgdp.mmp
gstfft.mmp
-liboil.mmp
+gstapp.mmp
-#ifdef VIDEO
// Video mmp
-gstvideo.mmp //compiled
-gstvideorate.mmp //compiled
-gstvideoscale.mmp // liboil //not compiled
-gstvideotestsrc.mmp // liboil
+gstvideo.mmp
+gstvideorate.mmp
+gstvideoscale.mmp
+gstvideotestsrc.mmp
ffmpegcolorspace.mmp
-#endif
+
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/ffmpegcolorspace.mmp
--- a/gst_plugins_base/group/ffmpegcolorspace.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/ffmpegcolorspace.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
*
*/
+
#include
TARGET libgstffmpegcolorspace.dll
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstadder.mmp
--- a/gst_plugins_base/group/gstadder.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstadder.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
*
*/
+
#include
TARGET libgstadder.dll
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstaudio.mmp
--- a/gst_plugins_base/group/gstaudio.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstaudio.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
*
*/
+
#include
TARGET libgstaudio.dll
@@ -52,8 +53,10 @@
USERINCLUDE ../../include/gstreamer/gst/dataprotocol
USERINCLUDE ../../include/gstreamer/gst/net
+USERINCLUDE ../gst-libs/audio
+
SOURCEPATH ../gst-libs/gst/audio
-SOURCE audio.c
+SOURCE audio.c audio-enumtypes.c
SOURCE gstaudioclock.c
SOURCE mixerutils.c
SOURCE multichannel.c
@@ -63,8 +66,6 @@
SOURCE gstbaseaudiosink.c
SOURCE gstbaseaudiosrc.c
SOURCE gstringbuffer.c
-SOURCE multichannel-enumtypes.c
-//SOURCE gstaudiofiltertemplate.c
LIBRARY euser.lib
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstaudioconvert.mmp
--- a/gst_plugins_base/group/gstaudioconvert.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstaudioconvert.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
*
*/
+
#include
TARGET libgstaudioconvert.dll
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstaudiorate.mmp
--- a/gst_plugins_base/group/gstaudiorate.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstaudiorate.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
*
*/
+
#include
TARGET libgstaudiorate.dll
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstaudioresample.mmp
--- a/gst_plugins_base/group/gstaudioresample.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstaudioresample.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
*
*/
+
#include
TARGET libgstaudioresample.dll
@@ -51,13 +52,12 @@
USERINCLUDE ../../include/gstreamer/gst/net
SOURCEPATH ../gst/audioresample
-SOURCE buffer.c
-SOURCE functable.c
+
SOURCE gstaudioresample.c
-SOURCE resample.c
-SOURCE resample_chunk.c
-SOURCE resample_functable.c
-SOURCE resample_ref.c
+//SOURCE resample.c
+SOURCE speex_resampler_double.c
+SOURCE speex_resampler_float.c
+SOURCE speex_resampler_int.c
LIBRARY euser.lib
LIBRARY libgobject.lib
@@ -66,6 +66,7 @@
LIBRARY libm.lib
LIBRARY libgstreamer.lib
LIBRARY libgstbase.lib
+LIBRARY liboil.lib
MACRO HAVE_CONFIG_H
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstcdda.mmp
--- a/gst_plugins_base/group/gstcdda.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstcdda.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -54,8 +54,6 @@
SOURCEPATH ../gst-libs/gst/cdda
SOURCE gstcddabasesrc.c
-SOURCE base64.c
-SOURCE sha1.c
LIBRARY euser.lib
LIBRARY libgobject.lib
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstdecodebin.mmp
--- a/gst_plugins_base/group/gstdecodebin.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstdecodebin.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
*
*/
+
#include
TARGET libgstdecodebin.dll
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstfft.mmp
--- a/gst_plugins_base/group/gstfft.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstfft.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
*
*/
+
#include
TARGET libgstfft.dll
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstinterfaces.mmp
--- a/gst_plugins_base/group/gstinterfaces.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstinterfaces.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
*
*/
+
#include
TARGET libgstinterfaces.dll
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstpbutils.mmp
--- a/gst_plugins_base/group/gstpbutils.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstpbutils.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
*
*/
+
#include
TARGET libgstpbutils.dll
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstplayback.mmp
--- a/gst_plugins_base/group/gstplayback.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstplayback.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -22,8 +22,8 @@
#include
-TARGET libgstplaybin.dll
-TARGETTYPE DLL
+TARGET libgstplayback.dll
+TARGETTYPE STDDLL
UID 0x20004c45 0x2001F43E
#ifdef EKA2
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstplaybin.mmp
--- a/gst_plugins_base/group/gstplaybin.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstplaybin.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -62,6 +62,7 @@
SOURCE gstscreenshot.c
SOURCE gststreaminfo.c
SOURCE gststreamselector.c
+SOURCE gstinputselector.c
SOURCE gstplay-enum.c
SOURCE gstplay-marshal.c
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstsubparse.mmp
--- a/gst_plugins_base/group/gstsubparse.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstsubparse.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -62,6 +62,7 @@
LIBRARY libglib.lib
LIBRARY libc.lib
LIBRARY libgstreamer.lib
+LIBRARY libgstbase.lib
MACRO HAVE_CONFIG_H
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstvideo.mmp
--- a/gst_plugins_base/group/gstvideo.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstvideo.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -56,6 +56,7 @@
SOURCE gstvideofilter.c
SOURCE gstvideosink.c
SOURCE video.c
+SOURCE video-enumtypes.c
//LIBRARY euser.lib
LIBRARY libc.lib
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstvideotestsrc.mmp
--- a/gst_plugins_base/group/gstvideotestsrc.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstvideotestsrc.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -23,7 +23,7 @@
#include
TARGET libgstvideotestsrc.dll
-TARGETTYPE dll
+TARGETTYPE DLL
UID 0x1000008d 0x2001F442
#ifdef EKA2
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/gstvolume.mmp
--- a/gst_plugins_base/group/gstvolume.mmp Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/group/gstvolume.mmp Wed Mar 24 18:04:17 2010 -0500
@@ -43,7 +43,7 @@
OS_LAYER_LIBC_SYSTEMINCLUDE
OS_LAYER_GLIB_SYSTEMINCLUDE
-//OS_LAYER_LIBOIL_SYSTEMINCLUDE SYSTEMINCLUDE
+OS_LAYER_LIBOIL_SYSTEMINCLUDE SYSTEMINCLUDE
USERINCLUDE ../../include/gstreamer
USERINCLUDE ../../include/gstreamer/gst
USERINCLUDE ../../include/gstreamer/gst/base
@@ -64,7 +64,7 @@
LIBRARY libpthread.lib
LIBRARY libc.lib
LIBRARY libgthread.lib
-LIBRARY liboil.lib
+LIBRARY liboil.lib
LIBRARY libgstreamer.lib
LIBRARY libgstbase.lib
LIBRARY libgstcontroller.lib
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/group/liboil.mmp
--- a/gst_plugins_base/group/liboil.mmp Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-
-#include
-
-TARGET liboil.dll
-TARGETTYPE dll
-UID 0x20004c45 0x2001F443
-
-#ifdef EKA2
-LANG SC
-CAPABILITY All -Tcb
-VENDORID VID_DEFAULT
-#endif
-
-#if !defined(__WINSCW__) && !defined(__WINS__)
-EpocAllowDllData
-#endif
-
-
-
-SOURCEPATH ../gst/oil
-
-SOURCE stub.c
-
-USERINCLUDE ../gst/oil
-USERINCLUDE ..
-
-MW_LAYER_SYSTEMINCLUDE
-OS_LAYER_LIBC_SYSTEMINCLUDE
-
-USERINCLUDE ../../include/gstreamer
-
-LIBRARY libc.lib
-
-
-SMPSAFE
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/app/gstapp-marshal.c
--- a/gst_plugins_base/gst-libs/gst/app/gstapp-marshal.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/app/gstapp-marshal.c Wed Mar 24 18:04:17 2010 -0500
@@ -1,21 +1,5 @@
-/* GStreamer
- * Copyright (C) 2007
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
+#include "gstapp-marshal.h"
+
#include
@@ -64,16 +48,14 @@
#endif /* !G_ENABLE_DEBUG */
-/* VOID:UINT (gstapp-marshal.list:1) */
-
-/* BOOLEAN:UINT64 (gstapp-marshal.list:2) */
+/* BOOLEAN:UINT64 (gstapp-marshal.list:1) */
void
__gst_app_marshal_BOOLEAN__UINT64 (GClosure *closure,
- GValue *return_value G_GNUC_UNUSED,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint G_GNUC_UNUSED,
- gpointer marshal_data)
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__UINT64) (gpointer data1,
guint64 arg_1,
@@ -105,14 +87,14 @@
g_value_set_boolean (return_value, v_return);
}
-/* ENUM:OBJECT (gstapp-marshal.list:3) */
+/* ENUM:OBJECT (gstapp-marshal.list:2) */
void
__gst_app_marshal_ENUM__OBJECT (GClosure *closure,
- GValue *return_value G_GNUC_UNUSED,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint G_GNUC_UNUSED,
- gpointer marshal_data)
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
{
typedef gint (*GMarshalFunc_ENUM__OBJECT) (gpointer data1,
gpointer arg_1,
@@ -144,14 +126,14 @@
g_value_set_enum (return_value, v_return);
}
-/* ENUM:VOID (gstapp-marshal.list:4) */
+/* ENUM:VOID (gstapp-marshal.list:3) */
void
__gst_app_marshal_ENUM__VOID (GClosure *closure,
- GValue *return_value G_GNUC_UNUSED,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint G_GNUC_UNUSED,
- gpointer marshal_data)
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
{
typedef gint (*GMarshalFunc_ENUM__VOID) (gpointer data1,
gpointer data2);
@@ -181,3 +163,5 @@
g_value_set_enum (return_value, v_return);
}
+/* VOID:UINT (gstapp-marshal.list:4) */
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/app/gstapp-marshal.h
--- a/gst_plugins_base/gst-libs/gst/app/gstapp-marshal.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/app/gstapp-marshal.h Wed Mar 24 18:04:17 2010 -0500
@@ -1,56 +1,39 @@
-/* GStreamer
- * Copyright (C) 2007
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __gst_app_marshal_MARSHAL_H__
-#define __gst_app_marshal_MARSHAL_H__
+
+#ifndef ____gst_app_marshal_MARSHAL_H__
+#define ____gst_app_marshal_MARSHAL_H__
#include
G_BEGIN_DECLS
-/* VOID:UINT (gstapp-marshal.list:1) */
-#define __gst_app_marshal_VOID__UINT g_cclosure_marshal_VOID__UINT
-
-/* BOOLEAN:UINT64 (gstapp-marshal.list:2) */
+/* BOOLEAN:UINT64 (gstapp-marshal.list:1) */
extern void __gst_app_marshal_BOOLEAN__UINT64 (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
-/* ENUM:OBJECT (gstapp-marshal.list:3) */
+/* ENUM:OBJECT (gstapp-marshal.list:2) */
extern void __gst_app_marshal_ENUM__OBJECT (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+
+/* ENUM:VOID (gstapp-marshal.list:3) */
+extern void __gst_app_marshal_ENUM__VOID (GClosure *closure,
GValue *return_value,
guint n_param_values,
const GValue *param_values,
gpointer invocation_hint,
gpointer marshal_data);
-/* ENUM:VOID (gstapp-marshal.list:4) */
-extern void __gst_app_marshal_ENUM__VOID (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+/* VOID:UINT (gstapp-marshal.list:4) */
+#define __gst_app_marshal_VOID__UINT g_cclosure_marshal_VOID__UINT
G_END_DECLS
-#endif /* __gst_app_marshal_MARSHAL_H__ */
+#endif /* ____gst_app_marshal_MARSHAL_H__ */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/app/gstapp-marshal.list
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/app/gstapp-marshal.list Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,5 @@
+BOOLEAN:UINT64
+ENUM:OBJECT
+ENUM:VOID
+VOID:UINT
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/app/gstappsink.c
--- a/gst_plugins_base/gst-libs/gst/app/gstappsink.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/app/gstappsink.c Wed Mar 24 18:04:17 2010 -0500
@@ -84,13 +84,12 @@
#include
#include
#include
+#include
#include
#include "gstappsink.h"
-#ifdef __SYMBIAN32__
-#include
-#endif
+
struct _GstAppSinkPrivate
{
GstCaps *caps;
@@ -120,10 +119,12 @@
SIGNAL_EOS,
SIGNAL_NEW_PREROLL,
SIGNAL_NEW_BUFFER,
+ SIGNAL_NEW_BUFFER_LIST,
/* actions */
SIGNAL_PULL_PREROLL,
SIGNAL_PULL_BUFFER,
+ SIGNAL_PULL_BUFFER_LIST,
LAST_SIGNAL
};
@@ -161,7 +162,6 @@
static void gst_app_sink_init (GstAppSink * appsink, GstAppSinkClass * klass);
static void gst_app_sink_base_init (gpointer g_class);
#endif
-
static void gst_app_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_app_sink_get_property (GObject * object, guint prop_id,
@@ -174,9 +174,14 @@
static gboolean gst_app_sink_event (GstBaseSink * sink, GstEvent * event);
static GstFlowReturn gst_app_sink_preroll (GstBaseSink * psink,
GstBuffer * buffer);
+static GstFlowReturn gst_app_sink_render_common (GstBaseSink * psink,
+ GstMiniObject * data, gboolean is_list);
static GstFlowReturn gst_app_sink_render (GstBaseSink * psink,
GstBuffer * buffer);
+static GstFlowReturn gst_app_sink_render_list (GstBaseSink * psink,
+ GstBufferList * list);
static GstCaps *gst_app_sink_getcaps (GstBaseSink * psink);
+static GstMiniObject *gst_app_sink_pull_object (GstAppSink * appsink);
static guint gst_app_sink_signals[LAST_SIGNAL] = { 0 };
@@ -204,7 +209,6 @@
g_type_class_peek_parent (g_class);
gst_app_sink_class_init ((GstAppSinkClass *)g_class);
}
-
EXPORT_C GType
gst_app_sink_get_type (void)
{
@@ -292,28 +296,28 @@
g_object_class_install_property (gobject_class, PROP_CAPS,
g_param_spec_boxed ("caps", "Caps",
"The allowed caps for the sink pad", GST_TYPE_CAPS,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_EOS,
g_param_spec_boolean ("eos", "EOS",
"Check if the sink is EOS or not started", DEFAULT_PROP_EOS,
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_EMIT_SIGNALS,
g_param_spec_boolean ("emit-signals", "Emit signals",
"Emit new-preroll and new-buffer signals", DEFAULT_PROP_EMIT_SIGNALS,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_MAX_BUFFERS,
g_param_spec_uint ("max-buffers", "Max Buffers",
"The maximum number of buffers to queue internally (0 = unlimited)",
0, G_MAXUINT, DEFAULT_PROP_MAX_BUFFERS,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_DROP,
g_param_spec_boolean ("drop", "Drop",
"Drop old buffers when the buffer queue is filled", DEFAULT_PROP_DROP,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSink::eos:
@@ -366,6 +370,26 @@
g_signal_new ("new-buffer", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstAppSinkClass, new_buffer),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
+ /**
+ * GstAppSink::new-buffer-list:
+ * @appsink: the appsink element that emited the signal
+ *
+ * Signal that a new bufferlist is available.
+ *
+ * This signal is emited from the steaming thread and only when the
+ * "emit-signals" property is %TRUE.
+ *
+ * The new buffer can be retrieved with the "pull-buffer-list" action
+ * signal or gst_app_sink_pull_buffe_listr() either from this signal callback
+ * or from any other thread.
+ *
+ * Note that this signal is only emited when the "emit-signals" property is
+ * set to %TRUE, which it is not by default for performance reasons.
+ */
+ gst_app_sink_signals[SIGNAL_NEW_BUFFER_LIST] =
+ g_signal_new ("new-buffer-list", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstAppSinkClass, new_buffer_list),
+ NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
/**
* GstAppSink::pull-preroll:
@@ -421,6 +445,32 @@
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GstAppSinkClass,
pull_buffer), NULL, NULL, gst_app_marshal_BUFFER__VOID,
GST_TYPE_BUFFER, 0, G_TYPE_NONE);
+ /**
+ * GstAppSink::pull-buffer-list:
+ * @appsink: the appsink element to emit this signal on
+ *
+ * This function blocks until a buffer list or EOS becomes available or the appsink
+ * element is set to the READY/NULL state.
+ *
+ * This function will only return bufferlists when the appsink is in the PLAYING
+ * state. All rendered bufferlists will be put in a queue so that the application
+ * can pull bufferlists at its own rate.
+ *
+ * Note that when the application does not pull bufferlists fast enough, the
+ * queued bufferlists could consume a lot of memory, especially when dealing with
+ * raw video frames. It's possible to control the behaviour of the queue with
+ * the "drop" and "max-buffers" properties.
+ *
+ * If an EOS event was received before any buffers, this function returns
+ * %NULL. Use gst_app_sink_is_eos () to check for the EOS condition.
+ *
+ * Returns: a #GstBufferList or NULL when the appsink is stopped or EOS.
+ */
+ gst_app_sink_signals[SIGNAL_PULL_BUFFER_LIST] =
+ g_signal_new ("pull-buffer-list", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GstAppSinkClass,
+ pull_buffer_list), NULL, NULL, gst_app_marshal_BUFFER__VOID,
+ GST_TYPE_BUFFER_LIST, 0, G_TYPE_NONE);
basesink_class->unlock = gst_app_sink_unlock_start;
basesink_class->unlock_stop = gst_app_sink_unlock_stop;
@@ -429,10 +479,12 @@
basesink_class->event = gst_app_sink_event;
basesink_class->preroll = gst_app_sink_preroll;
basesink_class->render = gst_app_sink_render;
+ basesink_class->render_list = gst_app_sink_render_list;
basesink_class->get_caps = gst_app_sink_getcaps;
klass->pull_preroll = gst_app_sink_pull_preroll;
klass->pull_buffer = gst_app_sink_pull_buffer;
+ klass->pull_buffer_list = gst_app_sink_pull_buffer_list;
g_type_class_add_private (klass, sizeof (GstAppSinkPrivate));
}
@@ -456,7 +508,7 @@
gst_app_sink_dispose (GObject * obj)
{
GstAppSink *appsink = GST_APP_SINK (obj);
- GstBuffer *buffer;
+ GstMiniObject *queue_obj;
GST_OBJECT_LOCK (appsink);
if (appsink->priv->caps) {
@@ -476,8 +528,8 @@
gst_buffer_unref (appsink->priv->preroll);
appsink->priv->preroll = NULL;
}
- while ((buffer = g_queue_pop_head (appsink->priv->queue)))
- gst_buffer_unref (buffer);
+ while ((queue_obj = g_queue_pop_head (appsink->priv->queue)))
+ gst_mini_object_unref (queue_obj);
g_mutex_unlock (appsink->priv->mutex);
G_OBJECT_CLASS (parent_class)->dispose (obj);
@@ -586,13 +638,13 @@
static void
gst_app_sink_flush_unlocked (GstAppSink * appsink)
{
- GstBuffer *buffer;
+ GstMiniObject *obj;
GST_DEBUG_OBJECT (appsink, "flush stop appsink");
appsink->priv->is_eos = FALSE;
gst_buffer_replace (&appsink->priv->preroll, NULL);
- while ((buffer = g_queue_pop_head (appsink->priv->queue)))
- gst_buffer_unref (buffer);
+ while ((obj = g_queue_pop_head (appsink->priv->queue)))
+ gst_mini_object_unref (obj);
g_cond_signal (appsink->priv->cond);
}
@@ -698,9 +750,9 @@
}
static GstFlowReturn
-gst_app_sink_render (GstBaseSink * psink, GstBuffer * buffer)
+gst_app_sink_render_common (GstBaseSink * psink, GstMiniObject * data,
+ gboolean is_list)
{
- GstFlowReturn res = GST_FLOW_OK;
GstAppSink *appsink = GST_APP_SINK (psink);
gboolean emit;
@@ -708,18 +760,18 @@
if (appsink->priv->flushing)
goto flushing;
- GST_DEBUG_OBJECT (appsink, "pushing render buffer %p on queue (%d)",
- buffer, appsink->priv->queue->length);
+ GST_DEBUG_OBJECT (appsink, "pushing render buffer%s %p on queue (%d)",
+ is_list ? " list" : "", data, appsink->priv->queue->length);
while (appsink->priv->max_buffers > 0 &&
appsink->priv->queue->length >= appsink->priv->max_buffers) {
if (appsink->priv->drop) {
- GstBuffer *buf;
+ GstMiniObject *obj;
- /* we need to drop the oldest buffer and try again */
- buf = g_queue_pop_head (appsink->priv->queue);
- GST_DEBUG_OBJECT (appsink, "dropping old buffer %p", buf);
- gst_buffer_unref (buf);
+ /* we need to drop the oldest buffer/list and try again */
+ obj = g_queue_pop_head (appsink->priv->queue);
+ GST_DEBUG_OBJECT (appsink, "dropping old buffer/list %p", obj);
+ gst_mini_object_unref (obj);
} else {
GST_DEBUG_OBJECT (appsink, "waiting for free space, length %d >= %d",
appsink->priv->queue->length, appsink->priv->max_buffers);
@@ -730,19 +782,22 @@
}
}
/* we need to ref the buffer when pushing it in the queue */
- g_queue_push_tail (appsink->priv->queue, gst_buffer_ref (buffer));
-
+ g_queue_push_tail (appsink->priv->queue, gst_mini_object_ref (data));
g_cond_signal (appsink->priv->cond);
emit = appsink->priv->emit_signals;
g_mutex_unlock (appsink->priv->mutex);
- if (appsink->priv->callbacks.new_buffer)
- res =
- appsink->priv->callbacks.new_buffer (appsink, appsink->priv->user_data);
- else if (emit)
- g_signal_emit (appsink, gst_app_sink_signals[SIGNAL_NEW_BUFFER], 0);
-
- return res;
+ if (is_list) {
+ if (appsink->priv->callbacks.new_buffer_list)
+ appsink->priv->callbacks.new_buffer_list (appsink,
+ appsink->priv->user_data);
+ } else {
+ if (appsink->priv->callbacks.new_buffer)
+ appsink->priv->callbacks.new_buffer (appsink, appsink->priv->user_data);
+ else if (emit)
+ g_signal_emit (appsink, gst_app_sink_signals[SIGNAL_NEW_BUFFER], 0);
+ }
+ return GST_FLOW_OK;
flushing:
{
@@ -752,6 +807,19 @@
}
}
+static GstFlowReturn
+gst_app_sink_render (GstBaseSink * psink, GstBuffer * buffer)
+{
+ return gst_app_sink_render_common (psink, GST_MINI_OBJECT_CAST (buffer),
+ FALSE);
+}
+
+static GstFlowReturn
+gst_app_sink_render_list (GstBaseSink * psink, GstBufferList * list)
+{
+ return gst_app_sink_render_common (psink, GST_MINI_OBJECT_CAST (list), TRUE);
+}
+
static GstCaps *
gst_app_sink_getcaps (GstBaseSink * psink)
{
@@ -768,6 +836,53 @@
return caps;
}
+static GstMiniObject *
+gst_app_sink_pull_object (GstAppSink * appsink)
+{
+ GstMiniObject *obj = NULL;
+
+ g_return_val_if_fail (appsink != NULL, NULL);
+ g_return_val_if_fail (GST_IS_APP_SINK (appsink), NULL);
+
+ g_mutex_lock (appsink->priv->mutex);
+
+ while (TRUE) {
+ GST_DEBUG_OBJECT (appsink, "trying to grab a buffer/list");
+ if (!appsink->priv->started)
+ goto not_started;
+
+ if (!g_queue_is_empty (appsink->priv->queue))
+ break;
+
+ if (appsink->priv->is_eos)
+ goto eos;
+
+ /* nothing to return, wait */
+ GST_DEBUG_OBJECT (appsink, "waiting for a buffer/list");
+ g_cond_wait (appsink->priv->cond, appsink->priv->mutex);
+ }
+ obj = g_queue_pop_head (appsink->priv->queue);
+ GST_DEBUG_OBJECT (appsink, "we have a buffer/list %p", obj);
+ g_cond_signal (appsink->priv->cond);
+ g_mutex_unlock (appsink->priv->mutex);
+
+ return obj;
+
+ /* special conditions */
+eos:
+ {
+ GST_DEBUG_OBJECT (appsink, "we are EOS, return NULL");
+ g_mutex_unlock (appsink->priv->mutex);
+ return NULL;
+ }
+not_started:
+ {
+ GST_DEBUG_OBJECT (appsink, "we are stopped, return NULL");
+ g_mutex_unlock (appsink->priv->mutex);
+ return NULL;
+ }
+}
+
/* external API */
/**
@@ -1111,51 +1226,38 @@
*
* Since: 0.10.22
*/
+
EXPORT_C GstBuffer *
gst_app_sink_pull_buffer (GstAppSink * appsink)
{
- GstBuffer *buf = NULL;
-
- g_return_val_if_fail (appsink != NULL, NULL);
- g_return_val_if_fail (GST_IS_APP_SINK (appsink), NULL);
-
- g_mutex_lock (appsink->priv->mutex);
-
- while (TRUE) {
- GST_DEBUG_OBJECT (appsink, "trying to grab a buffer");
- if (!appsink->priv->started)
- goto not_started;
-
- if (!g_queue_is_empty (appsink->priv->queue))
- break;
-
- if (appsink->priv->is_eos)
- goto eos;
+ GST_DEBUG_OBJECT (appsink, "pull a buffer");
+ return GST_BUFFER_CAST (gst_app_sink_pull_object (appsink));
+}
- /* nothing to return, wait */
- GST_DEBUG_OBJECT (appsink, "waiting for a buffer");
- g_cond_wait (appsink->priv->cond, appsink->priv->mutex);
- }
- buf = g_queue_pop_head (appsink->priv->queue);
- GST_DEBUG_OBJECT (appsink, "we have a buffer %p", buf);
- g_cond_signal (appsink->priv->cond);
- g_mutex_unlock (appsink->priv->mutex);
-
- return buf;
-
- /* special conditions */
-eos:
- {
- GST_DEBUG_OBJECT (appsink, "we are EOS, return NULL");
- g_mutex_unlock (appsink->priv->mutex);
- return NULL;
- }
-not_started:
- {
- GST_DEBUG_OBJECT (appsink, "we are stopped, return NULL");
- g_mutex_unlock (appsink->priv->mutex);
- return NULL;
- }
+/**
+ * gst_app_sink_pull_buffer_list:
+ * @appsink: a #GstAppSink
+ *
+ * This function blocks until a buffer list or EOS becomes available or the
+ * appsink element is set to the READY/NULL state.
+ *
+ * This function will only return buffer lists when the appsink is in the
+ * PLAYING state. All rendered buffer lists will be put in a queue so that
+ * the application can pull buffer lists at its own rate. Note that when
+ * the application does not pull buffer lists fast enough, the queued buffer
+ * lists could consume a lot of memory, especially when dealing with raw
+ * video frames.
+ *
+ * If an EOS event was received before any buffer lists, this function returns
+ * %NULL. Use gst_app_sink_is_eos () to check for the EOS condition.
+ *
+ * Returns: a #GstBufferList or NULL when the appsink is stopped or EOS.
+ */
+EXPORT_C GstBufferList *
+gst_app_sink_pull_buffer_list (GstAppSink * appsink)
+{
+ GST_DEBUG_OBJECT (appsink, "pull a buffer list");
+ return GST_BUFFER_LIST_CAST (gst_app_sink_pull_object (appsink));
}
/**
@@ -1174,7 +1276,7 @@
*
* Since: 0.10.23
*/
-void
+EXPORT_C void
gst_app_sink_set_callbacks (GstAppSink * appsink,
GstAppSinkCallbacks * callbacks, gpointer user_data, GDestroyNotify notify)
{
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/app/gstappsink.h
--- a/gst_plugins_base/gst-libs/gst/app/gstappsink.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/app/gstappsink.h Wed Mar 24 18:04:17 2010 -0500
@@ -57,6 +57,11 @@
* The new buffer can be retrieved with
* gst_app_sink_pull_buffer() either from this callback
* or from any other thread.
+ * @new_buffer_list: Called when a new bufferlist is available.
+ * This callback is called from the steaming thread.
+ * The new bufferlist can be retrieved with
+ * gst_app_sink_pull_buffer_list() either from this callback
+ * or from any other thread.
*
* A set of callbacks that can be installed on the appsink with
* gst_app_sink_set_callbacks().
@@ -64,12 +69,13 @@
* Since: 0.10.23
*/
typedef struct {
- void (*eos) (GstAppSink *sink, gpointer user_data);
- GstFlowReturn (*new_preroll) (GstAppSink *sink, gpointer user_data);
- GstFlowReturn (*new_buffer) (GstAppSink *sink, gpointer user_data);
+ void (*eos) (GstAppSink *sink, gpointer user_data);
+ GstFlowReturn (*new_preroll) (GstAppSink *sink, gpointer user_data);
+ GstFlowReturn (*new_buffer) (GstAppSink *sink, gpointer user_data);
+ GstFlowReturn (*new_buffer_list) (GstAppSink *sink, gpointer user_data);
/*< private >*/
- gpointer _gst_reserved[GST_PADDING];
+ gpointer _gst_reserved[GST_PADDING - 1];
} GstAppSinkCallbacks;
struct _GstAppSink
@@ -93,11 +99,15 @@
void (*new_buffer) (GstAppSink *sink);
/* actions */
- GstBuffer * (*pull_preroll) (GstAppSink *sink);
- GstBuffer * (*pull_buffer) (GstAppSink *sink);
+ GstBuffer * (*pull_preroll) (GstAppSink *sink);
+ GstBuffer * (*pull_buffer) (GstAppSink *sink);
+
+ /* ABI added */
+ GstBufferList * (*new_buffer_list) (GstAppSink *sink);
+ GstBufferList * (*pull_buffer_list) (GstAppSink *sink);
/*< private >*/
- gpointer _gst_reserved[GST_PADDING];
+ gpointer _gst_reserved[GST_PADDING - 2];
};
IMPORT_C GType gst_app_sink_get_type(void);
@@ -118,6 +128,7 @@
IMPORT_C GstBuffer * gst_app_sink_pull_preroll (GstAppSink *appsink);
IMPORT_C GstBuffer * gst_app_sink_pull_buffer (GstAppSink *appsink);
+IMPORT_C GstBufferList * gst_app_sink_pull_buffer_list (GstAppSink *appsink);
IMPORT_C void gst_app_sink_set_callbacks (GstAppSink * appsink,
GstAppSinkCallbacks *callbacks,
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/app/gstappsrc.c
--- a/gst_plugins_base/gst-libs/gst/app/gstappsrc.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/app/gstappsrc.c Wed Mar 24 18:04:17 2010 -0500
@@ -113,9 +113,6 @@
#include "gstapp-marshal.h"
#include "gstappsrc.h"
-#ifdef __SYMBIAN32__
-#include
-#endif
struct _GstAppSrcPrivate
{
@@ -225,7 +222,6 @@
static void gst_app_src_class_init (GstAppSrcClass * klass);
static void gst_app_src_init (GstAppSrc * appsrc, GstAppSrcClass * klass);
#endif
-
static void gst_app_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_app_src_get_property (GObject * object, guint prop_id,
@@ -267,7 +263,6 @@
GST_BOILERPLATE_FULL (GstAppSrc, gst_app_src, GstBaseSrc, GST_TYPE_BASE_SRC,
_do_init);
#else
-
static GstBaseSrcClass *parent_class = NULL;
static void
gst_app_src_class_init_trampoline (gpointer g_class,
@@ -277,7 +272,6 @@
g_type_class_peek_parent (g_class);
gst_app_src_class_init ((GstAppSrcClass *)g_class);
}
-
EXPORT_C GType
gst_app_src_get_type (void)
{
@@ -302,8 +296,6 @@
}
#endif
-
-
static void
gst_app_src_base_init (gpointer g_class)
{
@@ -340,7 +332,7 @@
g_object_class_install_property (gobject_class, PROP_CAPS,
g_param_spec_boxed ("caps", "Caps",
"The allowed caps for the src pad", GST_TYPE_CAPS,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSrc::format
*
@@ -350,7 +342,7 @@
g_object_class_install_property (gobject_class, PROP_FORMAT,
g_param_spec_enum ("format", "Format",
"The format of the segment events and seek", GST_TYPE_FORMAT,
- DEFAULT_PROP_FORMAT, G_PARAM_READWRITE));
+ DEFAULT_PROP_FORMAT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSrc::size
*
@@ -361,7 +353,7 @@
g_param_spec_int64 ("size", "Size",
"The size of the data stream in bytes (-1 if unknown)",
-1, G_MAXINT64, DEFAULT_PROP_SIZE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSrc::stream-type
*
@@ -372,7 +364,7 @@
g_param_spec_enum ("stream-type", "Stream Type",
"the type of the stream", GST_TYPE_APP_STREAM_TYPE,
DEFAULT_PROP_STREAM_TYPE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSrc::max-bytes
*
@@ -384,7 +376,7 @@
g_param_spec_uint64 ("max-bytes", "Max bytes",
"The maximum number of bytes to queue internally (0 = unlimited)",
0, G_MAXUINT64, DEFAULT_PROP_MAX_BYTES,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSrc::block
*
@@ -395,7 +387,7 @@
g_object_class_install_property (gobject_class, PROP_BLOCK,
g_param_spec_boolean ("block", "Block",
"Block push-buffer when max-bytes are queued",
- DEFAULT_PROP_BLOCK, G_PARAM_READWRITE));
+ DEFAULT_PROP_BLOCK, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSrc::is-live
@@ -406,7 +398,7 @@
g_object_class_install_property (gobject_class, PROP_IS_LIVE,
g_param_spec_boolean ("is-live", "Is Live",
"Whether to act as a live source",
- DEFAULT_PROP_IS_LIVE, G_PARAM_READWRITE ));
+ DEFAULT_PROP_IS_LIVE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSrc::min-latency
*
@@ -417,7 +409,7 @@
g_param_spec_int64 ("min-latency", "Min Latency",
"The minimum latency (-1 = default)",
-1, G_MAXINT64, DEFAULT_PROP_MIN_LATENCY,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSrc::max-latency
*
@@ -428,7 +420,7 @@
g_param_spec_int64 ("max-latency", "Max Latency",
"The maximum latency (-1 = unlimited)",
-1, G_MAXINT64, DEFAULT_PROP_MAX_LATENCY,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSrc::emit-signals
@@ -442,7 +434,7 @@
g_object_class_install_property (gobject_class, PROP_EMIT_SIGNALS,
g_param_spec_boolean ("emit-signals", "Emit signals",
"Emit new-preroll and new-buffer signals", DEFAULT_PROP_EMIT_SIGNALS,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstAppSrc::need-data:
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/TODO
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/audio/TODO Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,15 @@
+TODO
+----
+
+- audio base classes:
+ - GstBaseAudioSink
+ - parse caps into rinbuffer spec, also make sure surround sound
+ is parsed correctly.
+ - implement seek/query/convert
+ - implement getrange scheduling
+ - simple resampling
+ - more accurate master/slave calibration handling
+ - faster audio cutoff when going to PAUSED
+ - resubmit samples from ringbuffer when doing PAUSED->PLAYING again
+ - the ringbuffer should have a state where it is filling up the
+ buffer before going to playing.
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/audio-enumtypes.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/audio/audio-enumtypes.c Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,172 @@
+
+/* Generated data (by glib-mkenums) */
+
+#include "audio-enumtypes.h"
+
+#include "multichannel.h"
+#include "gstringbuffer.h"
+
+/* enumerations from "multichannel.h" */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GType
+gst_audio_channel_position_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_AUDIO_CHANNEL_POSITION_INVALID, "GST_AUDIO_CHANNEL_POSITION_INVALID", "invalid" },
+ { GST_AUDIO_CHANNEL_POSITION_FRONT_MONO, "GST_AUDIO_CHANNEL_POSITION_FRONT_MONO", "front-mono" },
+ { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, "GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT", "front-left" },
+ { GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, "GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT", "front-right" },
+ { GST_AUDIO_CHANNEL_POSITION_REAR_CENTER, "GST_AUDIO_CHANNEL_POSITION_REAR_CENTER", "rear-center" },
+ { GST_AUDIO_CHANNEL_POSITION_REAR_LEFT, "GST_AUDIO_CHANNEL_POSITION_REAR_LEFT", "rear-left" },
+ { GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT, "GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT", "rear-right" },
+ { GST_AUDIO_CHANNEL_POSITION_LFE, "GST_AUDIO_CHANNEL_POSITION_LFE", "lfe" },
+ { GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, "GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER", "front-center" },
+ { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER, "GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER", "front-left-of-center" },
+ { GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER, "GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER", "front-right-of-center" },
+ { GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT, "GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT", "side-left" },
+ { GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT, "GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT", "side-right" },
+ { GST_AUDIO_CHANNEL_POSITION_NONE, "GST_AUDIO_CHANNEL_POSITION_NONE", "none" },
+ { GST_AUDIO_CHANNEL_POSITION_NUM, "GST_AUDIO_CHANNEL_POSITION_NUM", "num" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstAudioChannelPosition", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+
+/* enumerations from "gstringbuffer.h" */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GType
+gst_ring_buffer_state_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_RING_BUFFER_STATE_STOPPED, "GST_RING_BUFFER_STATE_STOPPED", "stopped" },
+ { GST_RING_BUFFER_STATE_PAUSED, "GST_RING_BUFFER_STATE_PAUSED", "paused" },
+ { GST_RING_BUFFER_STATE_STARTED, "GST_RING_BUFFER_STATE_STARTED", "started" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstRingBufferState", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GType
+gst_ring_buffer_seg_state_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_SEGSTATE_INVALID, "GST_SEGSTATE_INVALID", "invalid" },
+ { GST_SEGSTATE_EMPTY, "GST_SEGSTATE_EMPTY", "empty" },
+ { GST_SEGSTATE_FILLED, "GST_SEGSTATE_FILLED", "filled" },
+ { GST_SEGSTATE_PARTIAL, "GST_SEGSTATE_PARTIAL", "partial" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstRingBufferSegState", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GType
+gst_buffer_format_type_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_BUFTYPE_LINEAR, "GST_BUFTYPE_LINEAR", "linear" },
+ { GST_BUFTYPE_FLOAT, "GST_BUFTYPE_FLOAT", "float" },
+ { GST_BUFTYPE_MU_LAW, "GST_BUFTYPE_MU_LAW", "mu-law" },
+ { GST_BUFTYPE_A_LAW, "GST_BUFTYPE_A_LAW", "a-law" },
+ { GST_BUFTYPE_IMA_ADPCM, "GST_BUFTYPE_IMA_ADPCM", "ima-adpcm" },
+ { GST_BUFTYPE_MPEG, "GST_BUFTYPE_MPEG", "mpeg" },
+ { GST_BUFTYPE_GSM, "GST_BUFTYPE_GSM", "gsm" },
+ { GST_BUFTYPE_IEC958, "GST_BUFTYPE_IEC958", "iec958" },
+ { GST_BUFTYPE_AC3, "GST_BUFTYPE_AC3", "ac3" },
+ { GST_BUFTYPE_EAC3, "GST_BUFTYPE_EAC3", "eac3" },
+ { GST_BUFTYPE_DTS, "GST_BUFTYPE_DTS", "dts" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstBufferFormatType", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GType
+gst_buffer_format_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_UNKNOWN, "GST_UNKNOWN", "unknown" },
+ { GST_S8, "GST_S8", "s8" },
+ { GST_U8, "GST_U8", "u8" },
+ { GST_S16_LE, "GST_S16_LE", "s16-le" },
+ { GST_S16_BE, "GST_S16_BE", "s16-be" },
+ { GST_U16_LE, "GST_U16_LE", "u16-le" },
+ { GST_U16_BE, "GST_U16_BE", "u16-be" },
+ { GST_S24_LE, "GST_S24_LE", "s24-le" },
+ { GST_S24_BE, "GST_S24_BE", "s24-be" },
+ { GST_U24_LE, "GST_U24_LE", "u24-le" },
+ { GST_U24_BE, "GST_U24_BE", "u24-be" },
+ { GST_S32_LE, "GST_S32_LE", "s32-le" },
+ { GST_S32_BE, "GST_S32_BE", "s32-be" },
+ { GST_U32_LE, "GST_U32_LE", "u32-le" },
+ { GST_U32_BE, "GST_U32_BE", "u32-be" },
+ { GST_S24_3LE, "GST_S24_3LE", "s24-3le" },
+ { GST_S24_3BE, "GST_S24_3BE", "s24-3be" },
+ { GST_U24_3LE, "GST_U24_3LE", "u24-3le" },
+ { GST_U24_3BE, "GST_U24_3BE", "u24-3be" },
+ { GST_S20_3LE, "GST_S20_3LE", "s20-3le" },
+ { GST_S20_3BE, "GST_S20_3BE", "s20-3be" },
+ { GST_U20_3LE, "GST_U20_3LE", "u20-3le" },
+ { GST_U20_3BE, "GST_U20_3BE", "u20-3be" },
+ { GST_S18_3LE, "GST_S18_3LE", "s18-3le" },
+ { GST_S18_3BE, "GST_S18_3BE", "s18-3be" },
+ { GST_U18_3LE, "GST_U18_3LE", "u18-3le" },
+ { GST_U18_3BE, "GST_U18_3BE", "u18-3be" },
+ { GST_FLOAT32_LE, "GST_FLOAT32_LE", "float32-le" },
+ { GST_FLOAT32_BE, "GST_FLOAT32_BE", "float32-be" },
+ { GST_FLOAT64_LE, "GST_FLOAT64_LE", "float64-le" },
+ { GST_FLOAT64_BE, "GST_FLOAT64_BE", "float64-be" },
+ { GST_MU_LAW, "GST_MU_LAW", "mu-law" },
+ { GST_A_LAW, "GST_A_LAW", "a-law" },
+ { GST_IMA_ADPCM, "GST_IMA_ADPCM", "ima-adpcm" },
+ { GST_MPEG, "GST_MPEG", "mpeg" },
+ { GST_GSM, "GST_GSM", "gsm" },
+ { GST_IEC958, "GST_IEC958", "iec958" },
+ { GST_AC3, "GST_AC3", "ac3" },
+ { GST_EAC3, "GST_EAC3", "eac3" },
+ { GST_DTS, "GST_DTS", "dts" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstBufferFormat", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+
+/* Generated data ends here */
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/audio-enumtypes.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/audio/audio-enumtypes.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,37 @@
+
+/* Generated data (by glib-mkenums) */
+
+#ifndef __GST_AUDIO_ENUM_TYPES_H__
+#define __GST_AUDIO_ENUM_TYPES_H__
+
+#include
+
+G_BEGIN_DECLS
+
+/* enumerations from "multichannel.h" */
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+GType gst_audio_channel_position_get_type (void);
+#define GST_TYPE_AUDIO_CHANNEL_POSITION (gst_audio_channel_position_get_type())
+
+/* enumerations from "gstringbuffer.h" */
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+GType gst_ring_buffer_state_get_type (void);
+#define GST_TYPE_RING_BUFFER_STATE (gst_ring_buffer_state_get_type())
+GType gst_ring_buffer_seg_state_get_type (void);
+#define GST_TYPE_RING_BUFFER_SEG_STATE (gst_ring_buffer_seg_state_get_type())
+GType gst_buffer_format_type_get_type (void);
+#define GST_TYPE_BUFFER_FORMAT_TYPE (gst_buffer_format_type_get_type())
+GType gst_buffer_format_get_type (void);
+#define GST_TYPE_BUFFER_FORMAT (gst_buffer_format_get_type())
+G_END_DECLS
+
+#endif /* __GST_AUDIO_ENUM_TYPES_H__ */
+
+/* Generated data ends here */
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/audio.c
--- a/gst_plugins_base/gst-libs/gst/audio/audio.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/audio.c Wed Mar 24 18:04:17 2010 -0500
@@ -16,27 +16,22 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+/**
+ * SECTION:gstaudio
+ * @short_description: Support library for audio elements
+ *
+ * This library contains some helper functions for audio elements.
+ */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "audio.h"
-#include "multichannel-enumtypes.h"
+#include "audio-enumtypes.h"
#include
-#ifdef __SYMBIAN32__
-#include
-#endif
-
-/**
- * SECTION:gstaudio
- * @short_description: Support library for audio elements
- *
- * This library contains some helper functions for audio elements.
- */
-
/**
* gst_audio_frame_byte_size:
* @pad: the #GstPad to get the caps from
@@ -117,7 +112,7 @@
* Calculate length in nanoseconds of audio buffer @buf based on capabilities of
* @pad.
*
- * Return: the length.
+ * Returns: the length.
*/
#ifdef __SYMBIAN32__
EXPORT_C
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/audio.h
--- a/gst_plugins_base/gst-libs/gst/audio/audio.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/audio.h Wed Mar 24 18:04:17 2010 -0500
@@ -77,6 +77,12 @@
*/
#define GST_AUDIO_DEF_RATE 44100
+/**
+ * GST_AUDIO_INT_PAD_TEMPLATE_CAPS:
+ *
+ * Template caps for integer audio. Can be used when defining a
+ * #GstStaticPadTemplate
+ */
#define GST_AUDIO_INT_PAD_TEMPLATE_CAPS \
"audio/x-raw-int, " \
"rate = (int) [ 1, MAX ], " \
@@ -86,7 +92,12 @@
"depth = (int) [ 1, 32 ], " \
"signed = (boolean) { true, false }"
-/* "standard" int audio is native order, 16 bit stereo. */
+/**
+ * GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS:
+ *
+ * Template caps for 16bit integer stereo audio in native byte-order.
+ * Can be used when defining a #GstStaticPadTemplate
+ */
#define GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS \
"audio/x-raw-int, " \
"rate = (int) [ 1, MAX ], " \
@@ -96,6 +107,12 @@
"depth = (int) 16, " \
"signed = (boolean) true"
+/**
+ * GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS:
+ *
+ * Template caps for float audio. Can be used when defining a
+ * #GstStaticPadTemplate
+ */
#define GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS \
"audio/x-raw-float, " \
"rate = (int) [ 1, MAX ], " \
@@ -103,7 +120,12 @@
"endianness = (int) { LITTLE_ENDIAN , BIG_ENDIAN }, " \
"width = (int) { 32, 64 }"
-/* "standard" float audio is native order, 32 bit mono. */
+/**
+ * GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS:
+ *
+ * Template caps for 32bit float mono audio in native byte-order.
+ * Can be used when defining a #GstStaticPadTemplate
+ */
#define GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS \
"audio/x-raw-float, " \
"width = (int) 32, " \
@@ -158,7 +180,7 @@
GST_AUDIO_FIELD_ENDIANNESS = (1 << 2),
GST_AUDIO_FIELD_WIDTH = (1 << 3),
GST_AUDIO_FIELD_DEPTH = (1 << 4),
- GST_AUDIO_FIELD_SIGNED = (1 << 5),
+ GST_AUDIO_FIELD_SIGNED = (1 << 5)
} GstAudioFieldFlag;
#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstaudioclock.c
--- a/gst_plugins_base/gst-libs/gst/audio/gstaudioclock.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstaudioclock.c Wed Mar 24 18:04:17 2010 -0500
@@ -39,6 +39,9 @@
#include "gstaudioclock.h"
+GST_DEBUG_CATEGORY_STATIC (gst_audio_clock_debug);
+#define GST_CAT_DEFAULT gst_audio_clock_debug
+
static void gst_audio_clock_class_init (GstAudioClockClass * klass);
static void gst_audio_clock_init (GstAudioClock * clock);
@@ -92,12 +95,16 @@
parent_class = g_type_class_peek_parent (klass);
gstclock_class->get_internal_time = gst_audio_clock_get_internal_time;
+
+ GST_DEBUG_CATEGORY_INIT (gst_audio_clock_debug, "audioclock", 0,
+ "audioclock");
}
static void
gst_audio_clock_init (GstAudioClock * clock)
{
clock->last_time = 0;
+ clock->abidata.ABI.time_offset = 0;
GST_OBJECT_FLAG_SET (clock, GST_CLOCK_FLAG_CAN_SET_MASTER);
}
@@ -118,7 +125,7 @@
#endif
GstClock *
-gst_audio_clock_new (gchar * name, GstAudioClockGetTimeFunc func,
+gst_audio_clock_new (const gchar * name, GstAudioClockGetTimeFunc func,
gpointer user_data)
{
GstAudioClock *aclock =
@@ -130,17 +137,119 @@
return (GstClock *) aclock;
}
+/**
+ * gst_audio_clock_reset:
+ * @clock: a #GstAudioClock
+ * @time: a #GstClockTime
+ *
+ * Inform @clock that future calls to #GstAudioClockGetTimeFunc will return values
+ * starting from @time. The clock will update an internal offset to make sure that
+ * future calls to internal_time will return an increasing result as required by
+ * the #GstClock object.
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_audio_clock_reset (GstAudioClock * clock, GstClockTime time)
+{
+ GstClockTimeDiff time_offset;
+
+ if (clock->last_time >= time)
+ time_offset = clock->last_time - time;
+ else
+ time_offset = -(time - clock->last_time);
+
+ clock->abidata.ABI.time_offset = time_offset;
+
+ GST_DEBUG_OBJECT (clock,
+ "reset clock to %" GST_TIME_FORMAT ", offset %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (time), GST_TIME_ARGS (time_offset));
+}
+
static GstClockTime
gst_audio_clock_get_internal_time (GstClock * clock)
{
- GstAudioClock *aclock = GST_AUDIO_CLOCK (clock);
+ GstAudioClock *aclock;
GstClockTime result;
+ aclock = GST_AUDIO_CLOCK_CAST (clock);
+
result = aclock->func (clock, aclock->user_data);
- if (result == GST_CLOCK_TIME_NONE)
+ if (result == GST_CLOCK_TIME_NONE) {
result = aclock->last_time;
- else
- aclock->last_time = result;
+ } else {
+ result += aclock->abidata.ABI.time_offset;
+ /* clock must be increasing */
+ if (aclock->last_time < result)
+ aclock->last_time = result;
+ else
+ result = aclock->last_time;
+ }
+
+ GST_DEBUG_OBJECT (clock,
+ "result %" GST_TIME_FORMAT ", last_time %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (result), GST_TIME_ARGS (aclock->last_time));
return result;
}
+
+/**
+ * gst_audio_clock_get_time:
+ * @clock: a #GstAudioClock
+ *
+ * Report the time as returned by the #GstAudioClockGetTimeFunc without applying
+ * any offsets.
+ *
+ * Returns: the time as reported by the time function of the audio clock
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstClockTime
+gst_audio_clock_get_time (GstClock * clock)
+{
+ GstAudioClock *aclock;
+ GstClockTime result;
+
+ aclock = GST_AUDIO_CLOCK_CAST (clock);
+
+ result = aclock->func (clock, aclock->user_data);
+ if (result == GST_CLOCK_TIME_NONE) {
+ result = aclock->last_time - aclock->abidata.ABI.time_offset;
+ }
+
+ return result;
+}
+
+/**
+ * gst_audio_clock_adjust:
+ * @clock: a #GstAudioClock
+ * @time: a #GstClockTime
+ *
+ * Adjust @time with the internal offset of the audio clock.
+ *
+ * Returns: @time adjusted with the internal offset.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstClockTime
+gst_audio_clock_adjust (GstClock * clock, GstClockTime time)
+{
+ GstAudioClock *aclock;
+ GstClockTime result;
+
+ aclock = GST_AUDIO_CLOCK_CAST (clock);
+
+ result = time + aclock->abidata.ABI.time_offset;
+
+ return result;
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstaudioclock.h
--- a/gst_plugins_base/gst-libs/gst/audio/gstaudioclock.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstaudioclock.h Wed Mar 24 18:04:17 2010 -0500
@@ -23,6 +23,7 @@
#ifndef __GST_AUDIO_CLOCK_H__
#define __GST_AUDIO_CLOCK_H__
+#include
#include
G_BEGIN_DECLS
@@ -37,6 +38,8 @@
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_CLOCK))
#define GST_IS_AUDIO_CLOCK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_CLOCK))
+#define GST_AUDIO_CLOCK_CAST(obj) \
+ ((GstAudioClock*)(obj))
typedef struct _GstAudioClock GstAudioClock;
typedef struct _GstAudioClockClass GstAudioClockClass;
@@ -71,7 +74,13 @@
GstClockTime last_time;
/*< private >*/
- gpointer _gst_reserved[GST_PADDING];
+ union {
+ struct {
+ GstClockTimeDiff time_offset;
+ } ABI;
+ /* adding + 0 to mark ABI change to be undone later */
+ gpointer _gst_reserved[GST_PADDING + 0];
+ } abidata;
};
struct _GstAudioClockClass {
@@ -90,8 +99,24 @@
IMPORT_C
#endif
-GstClock* gst_audio_clock_new (gchar *name, GstAudioClockGetTimeFunc func,
+GstClock* gst_audio_clock_new (const gchar *name, GstAudioClockGetTimeFunc func,
gpointer user_data);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+void gst_audio_clock_reset (GstAudioClock *clock, GstClockTime time);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GstClockTime gst_audio_clock_get_time (GstClock * clock);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+GstClockTime gst_audio_clock_adjust (GstClock * clock, GstClockTime time);
G_END_DECLS
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstaudiofilter.c
--- a/gst_plugins_base/gst-libs/gst/audio/gstaudiofilter.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstaudiofilter.c Wed Mar 24 18:04:17 2010 -0500
@@ -32,13 +32,14 @@
* their base_init function to easily configure the set of caps/formats that
* the element is able to handle.
*
- * Derived classes should override the GstAudioFilter::setup() and
- * GstBaseTransform::transform_ip() and/or GstBaseTransform::transform()
+ * Derived classes should override the #GstAudioFilterClass.setup() and
+ * #GstBaseTransformClass.transform_ip() and/or
+ * #GstBaseTransformClass.transform()
* virtual functions in their class_init function.
*
- * Since: 0.10.12
+ * Last reviewed on 2007-02-03 (0.10.11.1)
*
- * Last reviewed on 2007-02-03 (0.10.11.1)
+ * Since: 0.10.12
*/
#ifdef HAVE_CONFIG_H
@@ -168,8 +169,6 @@
GstAudioFilter *filter;
gboolean ret = TRUE;
- g_assert (gst_caps_is_equal (incaps, outcaps));
-
filter = GST_AUDIO_FILTER (btrans);
GST_LOG_OBJECT (filter, "caps: %" GST_PTR_FORMAT, incaps);
@@ -227,16 +226,19 @@
const GstCaps * allowed_caps)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+ GstPadTemplate *pad_template;
g_return_if_fail (GST_IS_AUDIO_FILTER_CLASS (klass));
g_return_if_fail (allowed_caps != NULL);
g_return_if_fail (GST_IS_CAPS (allowed_caps));
- gst_element_class_add_pad_template (element_class,
- gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
- gst_caps_copy (allowed_caps)));
+ pad_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
+ gst_caps_copy (allowed_caps));
+ gst_element_class_add_pad_template (element_class, pad_template);
+ gst_object_unref (pad_template);
- gst_element_class_add_pad_template (element_class,
- gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
- gst_caps_copy (allowed_caps)));
+ pad_template = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
+ gst_caps_copy (allowed_caps));
+ gst_element_class_add_pad_template (element_class, pad_template);
+ gst_object_unref (pad_template);
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstaudiofilter.h
--- a/gst_plugins_base/gst-libs/gst/audio/gstaudiofilter.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstaudiofilter.h Wed Mar 24 18:04:17 2010 -0500
@@ -61,6 +61,7 @@
/**
* GstAudioFilterClass:
+ * @basetransformclass: parent class
* @setup: virtual function called whenever the format changes
*
* In addition to the @setup virtual function, you should also override the
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstaudiofilterexample.c
--- a/gst_plugins_base/gst-libs/gst/audio/gstaudiofilterexample.c Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,262 +0,0 @@
-/* GStreamer
- * Copyright (C) <1999> Erik Walthinsen
- * Copyright (C) <2003> David Schleef
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * This file was (probably) generated from
- * gstaudiofiltertemplate.c,v 1.14 2007-02-03 23:28:45 tpm Exp
- * and
- * $Id: make_filter,v 1.3 2004-04-19 22:51:56 ds Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include
-#include
-#include
-#include
-
-GST_DEBUG_CATEGORY_STATIC (audio_filter_template_debug);
-#define GST_CAT_DEFAULT audio_filter_template_debug
-
-static const GstElementDetails audio_filter_template_details =
-GST_ELEMENT_DETAILS ("Audio filter template",
- "Filter/Effect/Audio",
- "Filters audio",
- "David Schleef ");
-
-typedef struct _GstAudioFilterTemplate GstAudioFilterTemplate;
-typedef struct _GstAudioFilterTemplateClass GstAudioFilterTemplateClass;
-
-#define GST_TYPE_AUDIO_FILTER_TEMPLATE \
- (gst_audio_filter_template_get_type())
-#define GST_AUDIO_FILTER_TEMPLATE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_FILTER_TEMPLATE,GstAudioFilterTemplate))
-#define GST_AUDIO_FILTER_TEMPLATE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_FILTER_TEMPLATE,GstAudioFilterTemplateClass))
-#define GST_IS_AUDIO_FILTER_TEMPLATE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_FILTER_TEMPLATE))
-#define GST_IS_AUDIO_FILTER_TEMPLATE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_FILTER_TEMPLATE))
-
-struct _GstAudioFilterTemplate
-{
- GstAudioFilter audiofilter;
-};
-
-struct _GstAudioFilterTemplateClass
-{
- GstAudioFilterClass parent_class;
-};
-
-
-enum
-{
- /* FILL ME */
- LAST_SIGNAL
-};
-
-enum
-{
- ARG_0
- /* FILL ME */
-};
-
-GST_BOILERPLATE (GstAudioFilterTemplate, gst_audio_filter_template,
- GstAudioFilter, GST_TYPE_AUDIO_FILTER);
-
-static void gst_audio_filter_template_set_property (GObject * object,
- guint prop_id, const GValue * value, GParamSpec * pspec);
-static void gst_audio_filter_template_get_property (GObject * object,
- guint prop_id, GValue * value, GParamSpec * pspec);
-
-static gboolean gst_audio_filter_template_setup (GstAudioFilter * filter,
- GstRingBufferSpec * spec);
-static GstFlowReturn gst_audio_filter_template_filter (GstBaseTransform * bt,
- GstBuffer * outbuf, GstBuffer * inbuf);
-static GstFlowReturn
-gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform,
- GstBuffer * buf);
-
-#define ALLOWED_CAPS_STRING \
- GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS
-
-static void
-gst_audio_filter_template_base_init (gpointer g_class)
-{
- GstAudioFilterTemplateClass *klass = (GstAudioFilterTemplateClass *) g_class;
- GstAudioFilterClass *audiofilter_class = GST_AUDIO_FILTER_CLASS (g_class);
- GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
- GstCaps *caps;
-
- gst_element_class_set_details (element_class, &audio_filter_template_details);
-
- caps = gst_caps_from_string (ALLOWED_CAPS_STRING);
- gst_audio_filter_class_add_pad_templates (audiofilter_class, caps);
- gst_caps_unref (caps);
-}
-
-static void
-gst_audio_filter_template_class_init (GstAudioFilterTemplateClass * klass)
-{
- GObjectClass *gobject_class;
- GstBaseTransformClass *btrans_class;
- GstAudioFilterClass *audio_filter_class;
-
- gobject_class = (GObjectClass *) klass;
- btrans_class = (GstBaseTransformClass *) klass;
- audio_filter_class = (GstAudioFilterClass *) klass;
-
-#if 0
- g_object_class_install_property (gobject_class, ARG_METHOD,
- g_param_spec_enum ("method", "method", "method",
- GST_TYPE_AUDIOTEMPLATE_METHOD, GST_AUDIOTEMPLATE_METHOD_1,
- G_PARAM_READWRITE));
-#endif
-
- gobject_class->set_property = gst_audio_filter_template_set_property;
- gobject_class->get_property = gst_audio_filter_template_get_property;
-
- /* this function will be called whenever the format changes */
- audio_filter_class->setup = gst_audio_filter_template_setup;
-
- /* here you set up functions to process data (either in place, or from
- * one input buffer to another output buffer); only one is required */
- btrans_class->transform = gst_audio_filter_template_filter;
- btrans_class->transform_ip = gst_audio_filter_template_filter_inplace;
-}
-
-static void
-gst_audio_filter_template_init (GstAudioFilterTemplate * audio_filter_template,
- GstAudioFilterTemplateClass * g_class)
-{
- GST_DEBUG ("init");
-
- /* do stuff if you need to */
-}
-
-static void
-gst_audio_filter_template_set_property (GObject * object, guint prop_id,
- const GValue * value, GParamSpec * pspec)
-{
- GstAudioFilterTemplate *filter;
-
- filter = GST_AUDIO_FILTER_TEMPLATE (object);
-
- GST_DEBUG ("set property %u", prop_id);
-
- GST_OBJECT_LOCK (filter);
- switch (prop_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
- GST_OBJECT_UNLOCK (filter);
-}
-
-static void
-gst_audio_filter_template_get_property (GObject * object, guint prop_id,
- GValue * value, GParamSpec * pspec)
-{
- GstAudioFilterTemplate *filter;
-
- filter = GST_AUDIO_FILTER_TEMPLATE (object);
-
- GST_DEBUG ("get property %u", prop_id);
-
- GST_OBJECT_LOCK (filter);
- switch (prop_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
- GST_OBJECT_UNLOCK (filter);
-}
-
-static gboolean
-gst_audio_filter_template_setup (GstAudioFilter * filter,
- GstRingBufferSpec * spec)
-{
- GstAudioFilterTemplate *audio_filter_template;
-
- audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (filter);
-
- /* if any setup needs to be done, do it here */
-
- return TRUE; /* it's all good */
-}
-
-/* You may choose to implement either a copying filter or an
- * in-place filter (or both). Implementing only one will give
- * full functionality, however, implementing both will cause
- * audiofilter to use the optimal function in every situation,
- * with a minimum of memory copies. */
-
-static GstFlowReturn
-gst_audio_filter_template_filter (GstBaseTransform * base_transform,
- GstBuffer * inbuf, GstBuffer * outbuf)
-{
- GstAudioFilterTemplate *audio_filter_template;
- GstAudioFilter *audiofilter;
-
- audiofilter = GST_AUDIO_FILTER (base_transform);
- audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (base_transform);
-
- /* do something interesting here. This simply copies the source
- * to the destination. */
-
- memcpy (GST_BUFFER_DATA (outbuf), GST_BUFFER_DATA (inbuf),
- GST_BUFFER_SIZE (inbuf));
-
- return GST_FLOW_OK;
-}
-
-static GstFlowReturn
-gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform,
- GstBuffer * buf)
-{
- GstAudioFilterTemplate *audio_filter_template;
- GstAudioFilter *audiofilter;
-
- audiofilter = GST_AUDIO_FILTER (base_transform);
- audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (base_transform);
-
- /* do something interesting here. This simply copies the source
- * to the destination. */
-
- return GST_FLOW_OK;
-}
-
-static gboolean
-plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (audio_filter_template_debug, "audiofilterexample",
- 0, "audiofilterexample");
-
- return gst_element_register (plugin, "audiofilterexample", GST_RANK_NONE,
- GST_TYPE_AUDIO_FILTER_TEMPLATE);
-}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "gstaudio_filter_template",
- "Audio filter template",
- plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstaudiofiltertemplate.c
--- a/gst_plugins_base/gst-libs/gst/audio/gstaudiofiltertemplate.c Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,262 +0,0 @@
-/* GStreamer
- * Copyright (C) <1999> Erik Walthinsen
- * Copyright (C) <2003> David Schleef
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * This file was (probably) generated from
- * $Id: gstaudiofiltertemplate.c,v 1.14 2007-02-03 23:28:45 tpm Exp $
- * and
- * MAKEFILTERVERSION
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include
-#include
-#include
-#include
-
-GST_DEBUG_CATEGORY_STATIC (audio_filter_template_debug);
-#define GST_CAT_DEFAULT audio_filter_template_debug
-
-static const GstElementDetails audio_filter_template_details =
-GST_ELEMENT_DETAILS ("Audio filter template",
- "Filter/Effect/Audio",
- "Filters audio",
- "David Schleef ");
-
-typedef struct _GstAudioFilterTemplate GstAudioFilterTemplate;
-typedef struct _GstAudioFilterTemplateClass GstAudioFilterTemplateClass;
-
-#define GST_TYPE_AUDIO_FILTER_TEMPLATE \
- (gst_audio_filter_template_get_type())
-#define GST_AUDIO_FILTER_TEMPLATE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_FILTER_TEMPLATE,GstAudioFilterTemplate))
-#define GST_AUDIO_FILTER_TEMPLATE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_FILTER_TEMPLATE,GstAudioFilterTemplateClass))
-#define GST_IS_AUDIO_FILTER_TEMPLATE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_FILTER_TEMPLATE))
-#define GST_IS_AUDIO_FILTER_TEMPLATE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_FILTER_TEMPLATE))
-
-struct _GstAudioFilterTemplate
-{
- GstAudioFilter audiofilter;
-};
-
-struct _GstAudioFilterTemplateClass
-{
- GstAudioFilterClass parent_class;
-};
-
-
-enum
-{
- /* FILL ME */
- LAST_SIGNAL
-};
-
-enum
-{
- ARG_0
- /* FILL ME */
-};
-
-GST_BOILERPLATE (GstAudioFilterTemplate, gst_audio_filter_template,
- GstAudioFilter, GST_TYPE_AUDIO_FILTER);
-
-static void gst_audio_filter_template_set_property (GObject * object,
- guint prop_id, const GValue * value, GParamSpec * pspec);
-static void gst_audio_filter_template_get_property (GObject * object,
- guint prop_id, GValue * value, GParamSpec * pspec);
-
-static gboolean gst_audio_filter_template_setup (GstAudioFilter * filter,
- GstRingBufferSpec * spec);
-static GstFlowReturn gst_audio_filter_template_filter (GstBaseTransform * bt,
- GstBuffer * outbuf, GstBuffer * inbuf);
-static GstFlowReturn
-gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform,
- GstBuffer * buf);
-
-#define ALLOWED_CAPS_STRING \
- GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS
-
-static void
-gst_audio_filter_template_base_init (gpointer g_class)
-{
- GstAudioFilterTemplateClass *klass = (GstAudioFilterTemplateClass *) g_class;
- GstAudioFilterClass *audiofilter_class = GST_AUDIO_FILTER_CLASS (g_class);
- GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
- GstCaps *caps;
-
- gst_element_class_set_details (element_class, &audio_filter_template_details);
-
- caps = gst_caps_from_string (ALLOWED_CAPS_STRING);
- gst_audio_filter_class_add_pad_templates (audiofilter_class, caps);
- gst_caps_unref (caps);
-}
-
-static void
-gst_audio_filter_template_class_init (GstAudioFilterTemplateClass * klass)
-{
- GObjectClass *gobject_class;
- GstBaseTransformClass *btrans_class;
- GstAudioFilterClass *audio_filter_class;
-
- gobject_class = (GObjectClass *) klass;
- btrans_class = (GstBaseTransformClass *) klass;
- audio_filter_class = (GstAudioFilterClass *) klass;
-
-#if 0
- g_object_class_install_property (gobject_class, ARG_METHOD,
- g_param_spec_enum ("method", "method", "method",
- GST_TYPE_AUDIOTEMPLATE_METHOD, GST_AUDIOTEMPLATE_METHOD_1,
- G_PARAM_READWRITE));
-#endif
-
- gobject_class->set_property = gst_audio_filter_template_set_property;
- gobject_class->get_property = gst_audio_filter_template_get_property;
-
- /* this function will be called whenever the format changes */
- audio_filter_class->setup = gst_audio_filter_template_setup;
-
- /* here you set up functions to process data (either in place, or from
- * one input buffer to another output buffer); only one is required */
- btrans_class->transform = gst_audio_filter_template_filter;
- btrans_class->transform_ip = gst_audio_filter_template_filter_inplace;
-}
-
-static void
-gst_audio_filter_template_init (GstAudioFilterTemplate * audio_filter_template,
- GstAudioFilterTemplateClass * g_class)
-{
- GST_DEBUG ("init");
-
- /* do stuff if you need to */
-}
-
-static void
-gst_audio_filter_template_set_property (GObject * object, guint prop_id,
- const GValue * value, GParamSpec * pspec)
-{
- GstAudioFilterTemplate *filter;
-
- filter = GST_AUDIO_FILTER_TEMPLATE (object);
-
- GST_DEBUG ("set property %u", prop_id);
-
- GST_OBJECT_LOCK (filter);
- switch (prop_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
- GST_OBJECT_UNLOCK (filter);
-}
-
-static void
-gst_audio_filter_template_get_property (GObject * object, guint prop_id,
- GValue * value, GParamSpec * pspec)
-{
- GstAudioFilterTemplate *filter;
-
- filter = GST_AUDIO_FILTER_TEMPLATE (object);
-
- GST_DEBUG ("get property %u", prop_id);
-
- GST_OBJECT_LOCK (filter);
- switch (prop_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
- GST_OBJECT_UNLOCK (filter);
-}
-
-static gboolean
-gst_audio_filter_template_setup (GstAudioFilter * filter,
- GstRingBufferSpec * spec)
-{
- GstAudioFilterTemplate *audio_filter_template;
-
- audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (filter);
-
- /* if any setup needs to be done, do it here */
-
- return TRUE; /* it's all good */
-}
-
-/* You may choose to implement either a copying filter or an
- * in-place filter (or both). Implementing only one will give
- * full functionality, however, implementing both will cause
- * audiofilter to use the optimal function in every situation,
- * with a minimum of memory copies. */
-
-static GstFlowReturn
-gst_audio_filter_template_filter (GstBaseTransform * base_transform,
- GstBuffer * inbuf, GstBuffer * outbuf)
-{
- GstAudioFilterTemplate *audio_filter_template;
- GstAudioFilter *audiofilter;
-
- audiofilter = GST_AUDIO_FILTER (base_transform);
- audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (base_transform);
-
- /* do something interesting here. This simply copies the source
- * to the destination. */
-
- memcpy (GST_BUFFER_DATA (outbuf), GST_BUFFER_DATA (inbuf),
- GST_BUFFER_SIZE (inbuf));
-
- return GST_FLOW_OK;
-}
-
-static GstFlowReturn
-gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform,
- GstBuffer * buf)
-{
- GstAudioFilterTemplate *audio_filter_template;
- GstAudioFilter *audiofilter;
-
- audiofilter = GST_AUDIO_FILTER (base_transform);
- audio_filter_template = GST_AUDIO_FILTER_TEMPLATE (base_transform);
-
- /* do something interesting here. This simply copies the source
- * to the destination. */
-
- return GST_FLOW_OK;
-}
-
-static gboolean
-plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (audio_filter_template_debug, "audiofiltertemplate",
- 0, "audiofiltertemplate");
-
- return gst_element_register (plugin, "audiofiltertemplate", GST_RANK_NONE,
- GST_TYPE_AUDIO_FILTER_TEMPLATE);
-}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "gstaudio_filter_template",
- "Audio filter template",
- plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstaudiosink.c
--- a/gst_plugins_base/gst-libs/gst/audio/gstaudiosink.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstaudiosink.c Wed Mar 24 18:04:17 2010 -0500
@@ -71,10 +71,6 @@
#include "gstaudiosink.h"
-#ifdef __SYMBIAN32__
-#include
-#endif
-
GST_DEBUG_CATEGORY_STATIC (gst_audio_sink_debug);
#define GST_CAT_DEFAULT gst_audio_sink_debug
@@ -133,6 +129,8 @@
static gboolean gst_audioringbuffer_pause (GstRingBuffer * buf);
static gboolean gst_audioringbuffer_stop (GstRingBuffer * buf);
static guint gst_audioringbuffer_delay (GstRingBuffer * buf);
+static gboolean gst_audioringbuffer_activate (GstRingBuffer * buf,
+ gboolean active);
/* ringbuffer abstract base class */
static GType
@@ -191,6 +189,8 @@
gstringbuffer_class->stop = GST_DEBUG_FUNCPTR (gst_audioringbuffer_stop);
gstringbuffer_class->delay = GST_DEBUG_FUNCPTR (gst_audioringbuffer_delay);
+ gstringbuffer_class->activate =
+ GST_DEBUG_FUNCPTR (gst_audioringbuffer_activate);
}
typedef guint (*WriteFunc) (GstAudioSink * sink, gpointer data, guint length);
@@ -207,36 +207,55 @@
GstAudioSinkClass *csink;
GstAudioRingBuffer *abuf = GST_AUDIORING_BUFFER_CAST (buf);
WriteFunc writefunc;
+ GstMessage *message;
+ GValue val = { 0 };
sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
csink = GST_AUDIO_SINK_GET_CLASS (sink);
GST_DEBUG_OBJECT (sink, "enter thread");
+ GST_OBJECT_LOCK (abuf);
+ GST_DEBUG_OBJECT (sink, "signal wait");
+ GST_AUDIORING_BUFFER_SIGNAL (buf);
+ GST_OBJECT_UNLOCK (abuf);
+
writefunc = csink->write;
if (writefunc == NULL)
goto no_function;
+ g_value_init (&val, G_TYPE_POINTER);
+ g_value_set_pointer (&val, sink->thread);
+ message = gst_message_new_stream_status (GST_OBJECT_CAST (buf),
+ GST_STREAM_STATUS_TYPE_ENTER, GST_ELEMENT_CAST (sink));
+ gst_message_set_stream_status_object (message, &val);
+ GST_DEBUG_OBJECT (sink, "posting ENTER stream status");
+ gst_element_post_message (GST_ELEMENT_CAST (sink), message);
+
while (TRUE) {
gint left, len;
guint8 *readptr;
gint readseg;
+ /* buffer must be started */
if (gst_ring_buffer_prepare_read (buf, &readseg, &readptr, &len)) {
- gint written = 0;
+ gint written;
left = len;
do {
- written = writefunc (sink, readptr + written, left);
+ written = writefunc (sink, readptr, left);
GST_LOG_OBJECT (sink, "transfered %d bytes of %d from segment %d",
written, left, readseg);
if (written < 0 || written > left) {
+ /* might not be critical, it e.g. happens when aborting playback */
GST_WARNING_OBJECT (sink,
- "error writing data (reason: %s), skipping segment",
- g_strerror (errno));
+ "error writing data in %s (reason: %s), skipping segment (left: %d, written: %d)",
+ GST_DEBUG_FUNCPTR_NAME (writefunc),
+ (errno > 1 ? g_strerror (errno) : "unknown"), left, written);
break;
}
left -= written;
+ readptr += written;
} while (left > 0);
/* clear written samples */
@@ -259,8 +278,9 @@
GST_OBJECT_UNLOCK (abuf);
}
}
- GST_DEBUG_OBJECT (sink, "exit thread");
+ /* Will never be reached */
+ g_assert_not_reached ();
return;
/* ERROR */
@@ -273,6 +293,11 @@
{
GST_OBJECT_UNLOCK (abuf);
GST_DEBUG_OBJECT (sink, "stop running, exit thread");
+ message = gst_message_new_stream_status (GST_OBJECT_CAST (buf),
+ GST_STREAM_STATUS_TYPE_LEAVE, GST_ELEMENT_CAST (sink));
+ gst_message_set_stream_status_object (message, &val);
+ GST_DEBUG_OBJECT (sink, "posting LEAVE stream status");
+ gst_element_post_message (GST_ELEMENT_CAST (sink), message);
return;
}
}
@@ -358,7 +383,6 @@
{
GstAudioSink *sink;
GstAudioSinkClass *csink;
- GstAudioRingBuffer *abuf;
gboolean result = FALSE;
sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
@@ -366,26 +390,18 @@
if (csink->prepare)
result = csink->prepare (sink, spec);
-
if (!result)
goto could_not_prepare;
- /* allocate one more segment as we need some headroom */
- spec->segtotal++;
+ /* set latency to one more segment as we need some headroom */
+ spec->seglatency = spec->segtotal + 1;
buf->data = gst_buffer_new_and_alloc (spec->segtotal * spec->segsize);
memset (GST_BUFFER_DATA (buf->data), 0, GST_BUFFER_SIZE (buf->data));
- abuf = GST_AUDIORING_BUFFER_CAST (buf);
- abuf->running = TRUE;
+ return TRUE;
- sink->thread =
- g_thread_create ((GThreadFunc) audioringbuffer_thread_func, buf, TRUE,
- NULL);
- GST_AUDIORING_BUFFER_WAIT (buf);
-
- return result;
-
+ /* ERRORS */
could_not_prepare:
{
GST_DEBUG_OBJECT (sink, "could not prepare device");
@@ -393,6 +409,55 @@
}
}
+static gboolean
+gst_audioringbuffer_activate (GstRingBuffer * buf, gboolean active)
+{
+ GstAudioSink *sink;
+ GstAudioRingBuffer *abuf;
+ GError *error = NULL;
+
+ sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
+ abuf = GST_AUDIORING_BUFFER_CAST (buf);
+
+ if (active) {
+ abuf->running = TRUE;
+
+ GST_DEBUG_OBJECT (sink, "starting thread");
+ sink->thread =
+ g_thread_create ((GThreadFunc) audioringbuffer_thread_func, buf, TRUE,
+ &error);
+ if (!sink->thread || error != NULL)
+ goto thread_failed;
+
+ GST_DEBUG_OBJECT (sink, "waiting for thread");
+ /* the object lock is taken */
+ GST_AUDIORING_BUFFER_WAIT (buf);
+ GST_DEBUG_OBJECT (sink, "thread is started");
+ } else {
+ abuf->running = FALSE;
+ GST_DEBUG_OBJECT (sink, "signal wait");
+ GST_AUDIORING_BUFFER_SIGNAL (buf);
+
+ GST_OBJECT_UNLOCK (buf);
+
+ /* join the thread */
+ g_thread_join (sink->thread);
+
+ GST_OBJECT_LOCK (buf);
+ }
+ return TRUE;
+
+ /* ERRORS */
+thread_failed:
+ {
+ if (error)
+ GST_ERROR_OBJECT (sink, "could not create thread %s", error->message);
+ else
+ GST_ERROR_OBJECT (sink, "could not create thread for unknown reason");
+ return FALSE;
+ }
+}
+
/* function is called with LOCK */
static gboolean
gst_audioringbuffer_release (GstRingBuffer * buf)
@@ -406,16 +471,6 @@
csink = GST_AUDIO_SINK_GET_CLASS (sink);
abuf = GST_AUDIORING_BUFFER_CAST (buf);
- abuf->running = FALSE;
- GST_DEBUG_OBJECT (sink, "signal wait");
- GST_AUDIORING_BUFFER_SIGNAL (buf);
- GST_OBJECT_UNLOCK (buf);
-
- /* join the thread */
- g_thread_join (sink->thread);
-
- GST_OBJECT_LOCK (buf);
-
/* free the buffer */
gst_buffer_unref (buf->data);
buf->data = NULL;
@@ -426,6 +481,8 @@
if (!result)
goto could_not_unprepare;
+ GST_DEBUG_OBJECT (sink, "unprepared");
+
return result;
could_not_unprepare:
@@ -484,12 +541,13 @@
csink->reset (sink);
GST_DEBUG_OBJECT (sink, "reset done");
}
-
+#if 0
if (abuf->running) {
GST_DEBUG_OBJECT (sink, "stop, waiting...");
GST_AUDIORING_BUFFER_WAIT (buf);
GST_DEBUG_OBJECT (sink, "stopped");
}
+#endif
return TRUE;
}
@@ -551,6 +609,8 @@
gstbaseaudiosink_class->create_ringbuffer =
GST_DEBUG_FUNCPTR (gst_audio_sink_create_ringbuffer);
+
+ g_type_class_ref (GST_TYPE_AUDIORING_BUFFER);
}
static void
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstaudiosink.h
--- a/gst_plugins_base/gst-libs/gst/audio/gstaudiosink.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstaudiosink.h Wed Mar 24 18:04:17 2010 -0500
@@ -83,6 +83,8 @@
/* close the device */
gboolean (*close) (GstAudioSink *sink);
/* write samples to the device */
+ /* FIXME 0.11: change return value to gint, as most implementation use that
+ * already anyway */
guint (*write) (GstAudioSink *sink, gpointer data, guint length);
/* get number of samples queued in the device */
guint (*delay) (GstAudioSink *sink);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstaudiosrc.c
--- a/gst_plugins_base/gst-libs/gst/audio/gstaudiosrc.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstaudiosrc.c Wed Mar 24 18:04:17 2010 -0500
@@ -71,10 +71,6 @@
#include "gstaudiosrc.h"
-#ifdef __SYMBIAN32__
-#include
-#endif
-
GST_DEBUG_CATEGORY_STATIC (gst_audio_src_debug);
#define GST_CAT_DEFAULT gst_audio_src_debug
@@ -203,6 +199,8 @@
GstAudioSrcClass *csrc;
GstAudioRingBuffer *abuf = GST_AUDIORING_BUFFER (buf);
ReadFunc readfunc;
+ GstMessage *message;
+ GValue val = { 0 };
src = GST_AUDIO_SRC (GST_OBJECT_PARENT (buf));
csrc = GST_AUDIO_SRC_GET_CLASS (src);
@@ -213,26 +211,35 @@
if (readfunc == NULL)
goto no_function;
+ g_value_init (&val, G_TYPE_POINTER);
+ g_value_set_pointer (&val, src->thread);
+ message = gst_message_new_stream_status (GST_OBJECT_CAST (buf),
+ GST_STREAM_STATUS_TYPE_ENTER, GST_ELEMENT_CAST (src));
+ gst_message_set_stream_status_object (message, &val);
+ GST_DEBUG_OBJECT (src, "posting ENTER stream status");
+ gst_element_post_message (GST_ELEMENT_CAST (src), message);
+
while (TRUE) {
gint left, len;
guint8 *readptr;
gint readseg;
if (gst_ring_buffer_prepare_read (buf, &readseg, &readptr, &len)) {
- gint read = 0;
+ gint read;
left = len;
do {
- read = readfunc (src, readptr + read, left);
+ read = readfunc (src, readptr, left);
GST_LOG_OBJECT (src, "transfered %d bytes of %d to segment %d", read,
left, readseg);
if (read < 0 || read > left) {
GST_WARNING_OBJECT (src,
- "error reading data (reason: %s), skipping segment",
+ "error reading data %d (reason: %s), skipping segment", read,
g_strerror (errno));
break;
}
left -= read;
+ readptr += read;
} while (left > 0);
/* we read one segment */
@@ -252,8 +259,9 @@
GST_OBJECT_UNLOCK (abuf);
}
}
- GST_DEBUG_OBJECT (src, "exit thread");
+ /* Will never be reached */
+ g_assert_not_reached ();
return;
/* ERROR */
@@ -266,6 +274,11 @@
{
GST_OBJECT_UNLOCK (abuf);
GST_DEBUG ("stop running, exit thread");
+ message = gst_message_new_stream_status (GST_OBJECT_CAST (buf),
+ GST_STREAM_STATUS_TYPE_LEAVE, GST_ELEMENT_CAST (src));
+ gst_message_set_stream_status_object (message, &val);
+ GST_DEBUG_OBJECT (src, "posting LEAVE stream status");
+ gst_element_post_message (GST_ELEMENT_CAST (src), message);
return;
}
}
@@ -364,9 +377,6 @@
if (!result)
goto could_not_open;
- /* allocate one more segment as we need some headroom */
- spec->segtotal++;
-
buf->data = gst_buffer_new_and_alloc (spec->segtotal * spec->segsize);
memset (GST_BUFFER_DATA (buf->data), 0, GST_BUFFER_SIZE (buf->data));
@@ -446,10 +456,11 @@
csrc->reset (src);
GST_DEBUG ("reset done");
}
-
+#if 0
GST_DEBUG ("stop, waiting...");
GST_AUDIORING_BUFFER_WAIT (buf);
GST_DEBUG ("stoped");
+#endif
return TRUE;
}
@@ -512,6 +523,8 @@
gstbaseaudiosrc_class->create_ringbuffer =
GST_DEBUG_FUNCPTR (gst_audio_src_create_ringbuffer);
+
+ g_type_class_ref (GST_TYPE_AUDIORING_BUFFER);
}
static void
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstaudiosrc.h
--- a/gst_plugins_base/gst-libs/gst/audio/gstaudiosrc.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstaudiosrc.h Wed Mar 24 18:04:17 2010 -0500
@@ -20,21 +20,6 @@
* Boston, MA 02111-1307, USA.
*/
-/* a base class for simple audio srcs.
- *
- * This base class only requires subclasses to implement a set
- * of simple functions.
- *
- * - open: open the device with the specified caps
- * - read: read samples to the audio device
- * - close: close the device
- * - delay: the number of samples queued in the device
- * - reset: unblock a read to the device and reset.
- *
- * All scheduling of samples and timestamps is done in this
- * base class.
- */
-
#ifndef __GST_AUDIO_SRC_H__
#define __GST_AUDIO_SRC_H__
@@ -53,6 +38,12 @@
typedef struct _GstAudioSrc GstAudioSrc;
typedef struct _GstAudioSrcClass GstAudioSrcClass;
+/**
+ * GstAudioSrc:
+ * @element: parent class
+ *
+ * Base class for simple audio sources.
+ */
struct _GstAudioSrc {
GstBaseAudioSrc element;
@@ -63,6 +54,20 @@
gpointer _gst_reserved[GST_PADDING];
};
+/**
+ * GstAudioSrcClass:
+ * @parent_class: the parent class.
+ * @open: open the device with the specified caps
+ * @prepare: configure device with format
+ * @unprepare: undo the configuration
+ * @close: close the device
+ * @read: read samples to the audio device
+ * @delay: the number of samples queued in the device
+ * @reset: unblock a read to the device and reset.
+ *
+ * #GstAudioSrc class. Override the vmethod to implement
+ * functionality.
+ */
struct _GstAudioSrcClass {
GstBaseAudioSrcClass parent_class;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosink.c
--- a/gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosink.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosink.c Wed Mar 24 18:04:17 2010 -0500
@@ -36,10 +36,6 @@
#include "gstbaseaudiosink.h"
-#ifdef __SYMBIAN32__
-#include
-#endif
-
GST_DEBUG_CATEGORY_STATIC (gst_base_audio_sink_debug);
#define GST_CAT_DEFAULT gst_base_audio_sink_debug
@@ -56,6 +52,10 @@
GstClockTimeDiff avg_skew;
/* the number of samples we aligned last time */
gint64 last_align;
+
+ gboolean sync_latency;
+
+ GstClockTime eos_time;
};
/* BaseAudioSink signals and args */
@@ -80,19 +80,25 @@
#define DEFAULT_PROVIDE_CLOCK TRUE
#define DEFAULT_SLAVE_METHOD GST_BASE_AUDIO_SINK_SLAVE_SKEW
+/* FIXME, enable pull mode when clock slaving and trick modes are figured out */
+#define DEFAULT_CAN_ACTIVATE_PULL FALSE
+
enum
{
PROP_0,
PROP_BUFFER_TIME,
PROP_LATENCY_TIME,
PROP_PROVIDE_CLOCK,
- PROP_SLAVE_METHOD
+ PROP_SLAVE_METHOD,
+ PROP_CAN_ACTIVATE_PULL
};
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
-#define GST_TYPE_SLAVE_METHOD (slave_method_get_type ())
-static GType
-slave_method_get_type (void)
+GType
+gst_base_audio_sink_slave_method_get_type (void)
{
static GType slave_method_type = 0;
static const GEnumValue slave_method[] = {
@@ -150,6 +156,9 @@
GstCaps * caps);
static void gst_base_audio_sink_fixate (GstBaseSink * bsink, GstCaps * caps);
+static gboolean gst_base_audio_sink_query_pad (GstPad * pad, GstQuery * query);
+
+
/* static guint gst_base_audio_sink_signals[LAST_SIGNAL] = { 0 }; */
static void
@@ -179,22 +188,30 @@
g_object_class_install_property (gobject_class, PROP_BUFFER_TIME,
g_param_spec_int64 ("buffer-time", "Buffer Time",
"Size of audio buffer in microseconds", 1,
- G_MAXINT64, DEFAULT_BUFFER_TIME, G_PARAM_READWRITE));
+ G_MAXINT64, DEFAULT_BUFFER_TIME,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_LATENCY_TIME,
g_param_spec_int64 ("latency-time", "Latency Time",
"Audio latency in microseconds", 1,
- G_MAXINT64, DEFAULT_LATENCY_TIME, G_PARAM_READWRITE));
+ G_MAXINT64, DEFAULT_LATENCY_TIME,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_PROVIDE_CLOCK,
g_param_spec_boolean ("provide-clock", "Provide Clock",
"Provide a clock to be used as the global pipeline clock",
- DEFAULT_PROVIDE_CLOCK, G_PARAM_READWRITE));
+ DEFAULT_PROVIDE_CLOCK, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_SLAVE_METHOD,
g_param_spec_enum ("slave-method", "Slave Method",
"Algorithm to use to match the rate of the masterclock",
- GST_TYPE_SLAVE_METHOD, DEFAULT_SLAVE_METHOD, G_PARAM_READWRITE));
+ GST_TYPE_BASE_AUDIO_SINK_SLAVE_METHOD, DEFAULT_SLAVE_METHOD,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (gobject_class, PROP_CAN_ACTIVATE_PULL,
+ g_param_spec_boolean ("can-activate-pull", "Allow Pull Scheduling",
+ "Allow pull-based scheduling", DEFAULT_CAN_ACTIVATE_PULL,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_base_audio_sink_change_state);
@@ -217,6 +234,7 @@
/* ref class from a thread-safe context to work around missing bit of
* thread-safety in GObject */
g_type_class_ref (GST_TYPE_AUDIO_CLOCK);
+ g_type_class_ref (GST_TYPE_RING_BUFFER);
}
static void
@@ -234,9 +252,11 @@
(GstAudioClockGetTimeFunc) gst_base_audio_sink_get_time, baseaudiosink);
GST_BASE_SINK (baseaudiosink)->can_activate_push = TRUE;
- /* FIXME, enable pull mode when segments, latency, state changes, negotiation
- * and clock slaving are figured out */
- GST_BASE_SINK (baseaudiosink)->can_activate_pull = FALSE;
+ GST_BASE_SINK (baseaudiosink)->can_activate_pull = DEFAULT_CAN_ACTIVATE_PULL;
+
+ /* install some custom pad_query functions */
+ gst_pad_set_query_function (GST_BASE_SINK_PAD (baseaudiosink),
+ GST_DEBUG_FUNCPTR (gst_base_audio_sink_query_pad));
}
static void
@@ -258,6 +278,7 @@
G_OBJECT_CLASS (parent_class)->dispose (object);
}
+
static GstClock *
gst_base_audio_sink_provide_clock (GstElement * elem)
{
@@ -297,11 +318,47 @@
}
static gboolean
+gst_base_audio_sink_query_pad (GstPad * pad, GstQuery * query)
+{
+ gboolean res = FALSE;
+ GstBaseAudioSink *basesink;
+
+ basesink = GST_BASE_AUDIO_SINK (gst_pad_get_parent (pad));
+
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_CONVERT:
+ {
+ GstFormat src_fmt, dest_fmt;
+ gint64 src_val, dest_val;
+
+ GST_LOG_OBJECT (pad, "query convert");
+
+ if (basesink->ringbuffer) {
+ gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, NULL);
+ res = gst_ring_buffer_convert (basesink->ringbuffer, src_fmt, src_val,
+ dest_fmt, &dest_val);
+ if (res) {
+ gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
+ }
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ gst_object_unref (basesink);
+
+ return res;
+}
+
+static gboolean
gst_base_audio_sink_query (GstElement * element, GstQuery * query)
{
gboolean res = FALSE;
+ GstBaseAudioSink *basesink;
- GstBaseAudioSink *basesink = GST_BASE_AUDIO_SINK (element);
+ basesink = GST_BASE_AUDIO_SINK (element);
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_LATENCY:
@@ -333,7 +390,7 @@
basesink->priv->us_latency = min_l;
min_latency =
- gst_util_uint64_scale_int (spec->segtotal * spec->segsize,
+ gst_util_uint64_scale_int (spec->seglatency * spec->segsize,
GST_SECOND, spec->rate * spec->bytes_per_sample);
/* we cannot go lower than the buffer size and the min peer latency */
@@ -349,13 +406,30 @@
} else {
GST_DEBUG_OBJECT (basesink,
"peer or we are not live, don't care about latency");
- min_latency = 0;
- max_latency = -1;
+ min_latency = min_l;
+ max_latency = max_l;
}
gst_query_set_latency (query, live, min_latency, max_latency);
}
break;
}
+ case GST_QUERY_CONVERT:
+ {
+ GstFormat src_fmt, dest_fmt;
+ gint64 src_val, dest_val;
+
+ GST_LOG_OBJECT (basesink, "query convert");
+
+ if (basesink->ringbuffer) {
+ gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, NULL);
+ res = gst_ring_buffer_convert (basesink->ringbuffer, src_fmt, src_val,
+ dest_fmt, &dest_val);
+ if (res) {
+ gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
+ }
+ }
+ break;
+ }
default:
res = GST_ELEMENT_CLASS (parent_class)->query (element, query);
break;
@@ -371,7 +445,7 @@
{
guint64 raw, samples;
guint delay;
- GstClockTime result, us_latency;
+ GstClockTime result;
if (sink->ringbuffer == NULL || sink->ringbuffer->spec.rate == 0)
return GST_CLOCK_TIME_NONE;
@@ -391,15 +465,10 @@
result = gst_util_uint64_scale_int (samples, GST_SECOND,
sink->ringbuffer->spec.rate);
- /* latency before starting the clock */
- us_latency = sink->priv->us_latency;
-
- result += us_latency;
-
GST_DEBUG_OBJECT (sink,
- "processed samples: raw %llu, delay %u, real %llu, time %"
- GST_TIME_FORMAT ", upstream latency %" GST_TIME_FORMAT, raw, delay,
- samples, GST_TIME_ARGS (result), GST_TIME_ARGS (us_latency));
+ "processed samples: raw %" G_GUINT64_FORMAT ", delay %u, real %"
+ G_GUINT64_FORMAT ", time %" GST_TIME_FORMAT,
+ raw, delay, samples, GST_TIME_ARGS (result));
return result;
}
@@ -532,6 +601,9 @@
case PROP_SLAVE_METHOD:
gst_base_audio_sink_set_slave_method (sink, g_value_get_enum (value));
break;
+ case PROP_CAN_ACTIVATE_PULL:
+ GST_BASE_SINK (sink)->can_activate_pull = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -559,6 +631,9 @@
case PROP_SLAVE_METHOD:
g_value_set_enum (value, gst_base_audio_sink_get_slave_method (sink));
break;
+ case PROP_CAN_ACTIVATE_PULL:
+ g_value_set_boolean (value, GST_BASE_SINK (sink)->can_activate_pull);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -579,6 +654,8 @@
GST_DEBUG_OBJECT (sink, "release old ringbuffer");
/* release old ringbuffer */
+ gst_ring_buffer_pause (sink->ringbuffer);
+ gst_ring_buffer_activate (sink->ringbuffer, FALSE);
gst_ring_buffer_release (sink->ringbuffer);
GST_DEBUG_OBJECT (sink, "parse caps");
@@ -592,11 +669,15 @@
gst_ring_buffer_debug_spec_buff (spec);
- GST_DEBUG_OBJECT (sink, "acquire new ringbuffer");
-
+ GST_DEBUG_OBJECT (sink, "acquire ringbuffer");
if (!gst_ring_buffer_acquire (sink->ringbuffer, spec))
goto acquire_error;
+ if (bsink->pad_mode == GST_ACTIVATE_PUSH) {
+ GST_DEBUG_OBJECT (sink, "activate ringbuffer");
+ gst_ring_buffer_activate (sink->ringbuffer, TRUE);
+ }
+
/* calculate actual latency and buffer times.
* FIXME: In 0.11, store the latency_time internally in ns */
spec->latency_time = gst_util_uint64_scale (spec->segsize,
@@ -663,8 +744,6 @@
static gboolean
gst_base_audio_sink_drain (GstBaseAudioSink * sink)
{
- GstClockTime base_time;
-
if (!sink->ringbuffer)
return TRUE;
if (!sink->ringbuffer->spec.rate)
@@ -676,35 +755,16 @@
if (gst_ring_buffer_is_acquired (sink->ringbuffer))
gst_ring_buffer_start (sink->ringbuffer);
- if (sink->next_sample != -1) {
- GstClockTime time;
-
- /* convert next expected sample to time */
- time =
- gst_util_uint64_scale_int (sink->next_sample, GST_SECOND,
- sink->ringbuffer->spec.rate);
-
+ if (sink->priv->eos_time != -1) {
GST_DEBUG_OBJECT (sink,
- "last sample %" G_GUINT64_FORMAT ", time %" GST_TIME_FORMAT,
- sink->next_sample, GST_TIME_ARGS (time));
-
- /* our time already includes the base_time, _wait_eos() wants a running_time
- * so we have to subtract the base_time again here. FIXME, store an
- * unadjusted EOS time so that we don't have to do this. */
- GST_OBJECT_LOCK (sink);
- base_time = GST_ELEMENT_CAST (sink)->base_time;
- GST_OBJECT_UNLOCK (sink);
-
- if (time > base_time)
- time -= base_time;
- else
- time = 0;
+ "last sample time %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (sink->priv->eos_time));
/* wait for the EOS time to be reached, this is the time when the last
* sample is played. */
- gst_base_sink_wait_eos (GST_BASE_SINK (sink), time, NULL);
+ gst_base_sink_wait_eos (GST_BASE_SINK (sink), sink->priv->eos_time, NULL);
- sink->next_sample = -1;
+ GST_DEBUG_OBJECT (sink, "drained audio");
}
return TRUE;
}
@@ -723,6 +783,7 @@
/* always resync on sample after a flush */
sink->priv->avg_skew = -1;
sink->next_sample = -1;
+ sink->priv->eos_time = -1;
if (sink->ringbuffer)
gst_ring_buffer_set_flushing (sink->ringbuffer, FALSE);
break;
@@ -803,8 +864,7 @@
static GstClockTime
clock_convert_external (GstClockTime external, GstClockTime cinternal,
- GstClockTime cexternal, GstClockTime crate_num, GstClockTime crate_denom,
- GstClockTime us_latency)
+ GstClockTime cexternal, GstClockTime crate_num, GstClockTime crate_denom)
{
/* adjust for rate and speed */
if (external >= cexternal) {
@@ -812,19 +872,13 @@
gst_util_uint64_scale (external - cexternal, crate_denom, crate_num);
external += cinternal;
} else {
- external = gst_util_uint64_scale (cexternal - external,
- crate_denom, crate_num);
+ external =
+ gst_util_uint64_scale (cexternal - external, crate_denom, crate_num);
if (cinternal > external)
external = cinternal - external;
else
external = 0;
}
- /* adjust for offset when slaving started */
- if (external > us_latency)
- external -= us_latency;
- else
- external = 0;
-
return external;
}
@@ -838,6 +892,22 @@
GstClockTime cinternal, cexternal;
GstClockTime crate_num, crate_denom;
+ /* FIXME, we can sample and add observations here or use the timeouts on the
+ * clock. No idea which one is better or more stable. The timeout seems more
+ * arbitrary but this one seems more demanding and does not work when there is
+ * no data comming in to the sink. */
+#if 0
+ GstClockTime etime, itime;
+ gdouble r_squared;
+
+ /* sample clocks and figure out clock skew */
+ etime = gst_clock_get_time (GST_ELEMENT_CLOCK (sink));
+ itime = gst_audio_clock_get_time (sink->provided_clock);
+
+ /* add new observation */
+ gst_clock_add_observation (sink->provided_clock, itime, etime, &r_squared);
+#endif
+
/* get calibration parameters to compensate for speed and offset differences
* when we are slaved */
gst_clock_get_calibration (sink->provided_clock, &cinternal, &cexternal,
@@ -854,9 +924,9 @@
/* bring external time to internal time */
render_start = clock_convert_external (render_start, cinternal, cexternal,
- crate_num, crate_denom, sink->priv->us_latency);
+ crate_num, crate_denom);
render_stop = clock_convert_external (render_stop, cinternal, cexternal,
- crate_num, crate_denom, sink->priv->us_latency);
+ crate_num, crate_denom);
GST_DEBUG_OBJECT (sink,
"after slaving: start %" GST_TIME_FORMAT " - stop %" GST_TIME_FORMAT,
@@ -885,11 +955,21 @@
/* sample clocks and figure out clock skew */
etime = gst_clock_get_time (GST_ELEMENT_CLOCK (sink));
- itime = gst_clock_get_internal_time (sink->provided_clock);
+ itime = gst_audio_clock_get_time (sink->provided_clock);
+
+ GST_DEBUG_OBJECT (sink,
+ "internal %" GST_TIME_FORMAT " external %" GST_TIME_FORMAT
+ " cinternal %" GST_TIME_FORMAT " cexternal %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (itime), GST_TIME_ARGS (etime),
+ GST_TIME_ARGS (cinternal), GST_TIME_ARGS (cexternal));
- etime -= cexternal;
- itime -= cinternal;
+ /* make sure we never go below 0 */
+ etime = etime > cexternal ? etime - cexternal : 0;
+ itime = itime > cinternal ? itime - cinternal : 0;
+ /* do itime - etime.
+ * positive value means external clock goes slower
+ * negative value means external clock goes faster */
skew = GST_CLOCK_DIFF (etime, itime);
if (sink->priv->avg_skew == -1) {
/* first observation */
@@ -913,7 +993,7 @@
GST_WARNING_OBJECT (sink,
"correct clock skew %" G_GINT64_FORMAT " > %" G_GINT64_FORMAT,
sink->priv->avg_skew, segtime2);
- cinternal += segtime;
+ cexternal = cexternal > segtime ? cexternal - segtime : 0;
sink->priv->avg_skew -= segtime;
segsamples =
@@ -960,9 +1040,9 @@
/* convert, ignoring speed */
render_start = clock_convert_external (render_start, cinternal, cexternal,
- crate_num, crate_denom, sink->priv->us_latency);
+ crate_num, crate_denom);
render_stop = clock_convert_external (render_stop, cinternal, cexternal,
- crate_num, crate_denom, sink->priv->us_latency);
+ crate_num, crate_denom);
*srender_start = render_start;
*srender_stop = render_stop;
@@ -982,9 +1062,9 @@
/* convert, ignoring speed */
render_start = clock_convert_external (render_start, cinternal, cexternal,
- crate_num, crate_denom, sink->priv->us_latency);
+ crate_num, crate_denom);
render_stop = clock_convert_external (render_stop, cinternal, cexternal,
- crate_num, crate_denom, sink->priv->us_latency);
+ crate_num, crate_denom);
*srender_start = render_start;
*srender_stop = render_stop;
@@ -1015,11 +1095,137 @@
}
}
+/* must be called with LOCK */
+static GstFlowReturn
+gst_base_audio_sink_sync_latency (GstBaseSink * bsink, GstMiniObject * obj)
+{
+ GstClock *clock;
+ GstClockReturn status;
+ GstClockTime time;
+ GstFlowReturn ret;
+ GstBaseAudioSink *sink;
+ GstClockTime itime, etime;
+ GstClockTime rate_num, rate_denom;
+ GstClockTimeDiff jitter;
+
+ sink = GST_BASE_AUDIO_SINK (bsink);
+
+ clock = GST_ELEMENT_CLOCK (sink);
+ if (G_UNLIKELY (clock == NULL))
+ goto no_clock;
+
+ /* we provided the global clock, don't need to do anything special */
+ if (clock == sink->provided_clock)
+ goto no_slaving;
+
+ GST_OBJECT_UNLOCK (sink);
+
+ do {
+ GST_DEBUG_OBJECT (sink, "checking preroll");
+
+ ret = gst_base_sink_do_preroll (bsink, obj);
+ if (ret != GST_FLOW_OK)
+ goto flushing;
+
+ GST_OBJECT_LOCK (sink);
+ time = sink->priv->us_latency;
+ GST_OBJECT_UNLOCK (sink);
+
+ /* preroll done, we can sync since we are in PLAYING now. */
+ GST_DEBUG_OBJECT (sink, "possibly waiting for clock to reach %"
+ GST_TIME_FORMAT, GST_TIME_ARGS (time));
+
+ /* wait for the clock, this can be interrupted because we got shut down or
+ * we PAUSED. */
+ status = gst_base_sink_wait_clock (bsink, time, &jitter);
+
+ GST_DEBUG_OBJECT (sink, "clock returned %d %" GST_TIME_FORMAT, status,
+ GST_TIME_ARGS (jitter));
+
+ /* invalid time, no clock or sync disabled, just continue then */
+ if (status == GST_CLOCK_BADTIME)
+ break;
+
+ /* waiting could have been interrupted and we can be flushing now */
+ if (G_UNLIKELY (bsink->flushing))
+ goto flushing;
+
+ /* retry if we got unscheduled, which means we did not reach the timeout
+ * yet. if some other error occures, we continue. */
+ } while (status == GST_CLOCK_UNSCHEDULED);
+
+ GST_OBJECT_LOCK (sink);
+ GST_DEBUG_OBJECT (sink, "latency synced");
+
+ /* when we prerolled in time, we can accurately set the calibration,
+ * our internal clock should exactly have been the latency (== the running
+ * time of the external clock) */
+ etime = GST_ELEMENT_CAST (sink)->base_time + time;
+ itime = gst_audio_clock_get_time (sink->provided_clock);
+
+ if (status == GST_CLOCK_EARLY) {
+ /* when we prerolled late, we have to take into account the lateness */
+ GST_DEBUG_OBJECT (sink, "late preroll, adding jitter");
+ etime += jitter;
+ }
+
+ /* start ringbuffer so we can start slaving right away when we need to */
+ gst_ring_buffer_start (sink->ringbuffer);
+
+ GST_DEBUG_OBJECT (sink,
+ "internal time: %" GST_TIME_FORMAT " external time: %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (itime), GST_TIME_ARGS (etime));
+
+ /* copy the original calibrated rate but update the internal and external
+ * times. */
+ gst_clock_get_calibration (sink->provided_clock, NULL, NULL, &rate_num,
+ &rate_denom);
+ gst_clock_set_calibration (sink->provided_clock, itime, etime,
+ rate_num, rate_denom);
+
+ switch (sink->priv->slave_method) {
+ case GST_BASE_AUDIO_SINK_SLAVE_RESAMPLE:
+ /* only set as master when we are resampling */
+ GST_DEBUG_OBJECT (sink, "Setting clock as master");
+ gst_clock_set_master (sink->provided_clock, clock);
+ break;
+ case GST_BASE_AUDIO_SINK_SLAVE_SKEW:
+ case GST_BASE_AUDIO_SINK_SLAVE_NONE:
+ default:
+ break;
+ }
+
+ sink->priv->avg_skew = -1;
+ sink->next_sample = -1;
+ sink->priv->eos_time = -1;
+
+ return GST_FLOW_OK;
+
+ /* ERRORS */
+no_clock:
+ {
+ GST_DEBUG_OBJECT (sink, "we have no clock");
+ return GST_FLOW_OK;
+ }
+no_slaving:
+ {
+ GST_DEBUG_OBJECT (sink, "we are not slaved");
+ return GST_FLOW_OK;
+ }
+flushing:
+ {
+ GST_DEBUG_OBJECT (sink, "we are flushing");
+ GST_OBJECT_LOCK (sink);
+ return GST_FLOW_WRONG_STATE;
+ }
+}
+
static GstFlowReturn
gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf)
{
guint64 in_offset;
GstClockTime time, stop, render_start, render_stop, sample_offset;
+ GstClockTimeDiff sync_offset, ts_offset;
GstBaseAudioSink *sink;
GstRingBuffer *ringbuf;
gint64 diff, align, ctime, cstop;
@@ -1029,9 +1235,11 @@
gint bps;
gint accum;
gint out_samples;
- GstClockTime base_time = GST_CLOCK_TIME_NONE, latency;
+ GstClockTime base_time, render_delay, latency;
GstClock *clock;
gboolean sync, slaved, align_next;
+ GstFlowReturn ret;
+ GstSegment clip_seg;
sink = GST_BASE_AUDIO_SINK (bsink);
@@ -1041,6 +1249,22 @@
if (G_UNLIKELY (!gst_ring_buffer_is_acquired (ringbuf)))
goto wrong_state;
+ /* Wait for upstream latency before starting the ringbuffer, we do this so
+ * that we can align the first sample of the ringbuffer to the base_time +
+ * latency. */
+ GST_OBJECT_LOCK (sink);
+ base_time = GST_ELEMENT_CAST (sink)->base_time;
+ if (G_UNLIKELY (sink->priv->sync_latency)) {
+ ret = gst_base_audio_sink_sync_latency (bsink, GST_MINI_OBJECT_CAST (buf));
+ GST_OBJECT_UNLOCK (sink);
+ if (G_UNLIKELY (ret != GST_FLOW_OK))
+ goto sync_latency_failed;
+ /* only do this once until we are set back to PLAYING */
+ sink->priv->sync_latency = FALSE;
+ } else {
+ GST_OBJECT_UNLOCK (sink);
+ }
+
bps = ringbuf->spec.bytes_per_sample;
size = GST_BUFFER_SIZE (buf);
@@ -1052,12 +1276,10 @@
in_offset = GST_BUFFER_OFFSET (buf);
time = GST_BUFFER_TIMESTAMP (buf);
- stop = time + gst_util_uint64_scale_int (samples, GST_SECOND,
- ringbuf->spec.rate);
GST_DEBUG_OBJECT (sink,
- "time %" GST_TIME_FORMAT ", offset %llu, start %" GST_TIME_FORMAT
- ", samples %u", GST_TIME_ARGS (time), in_offset,
+ "time %" GST_TIME_FORMAT ", offset %" G_GUINT64_FORMAT ", start %"
+ GST_TIME_FORMAT ", samples %u", GST_TIME_ARGS (time), in_offset,
GST_TIME_ARGS (bsink->segment.start), samples);
data = GST_BUFFER_DATA (buf);
@@ -1070,16 +1292,48 @@
GST_DEBUG_OBJECT (sink,
"Buffer of size %u has no time. Using render_start=%" G_GUINT64_FORMAT,
GST_BUFFER_SIZE (buf), render_start);
+ /* we don't have a start so we don't know stop either */
+ stop = -1;
goto no_sync;
}
+ /* let's calc stop based on the number of samples in the buffer instead
+ * of trusting the DURATION */
+ stop = time + gst_util_uint64_scale_int (samples, GST_SECOND,
+ ringbuf->spec.rate);
+
+ /* prepare the clipping segment. Since we will be subtracting ts-offset and
+ * device-delay later we scale the start and stop with those values so that we
+ * can correctly clip them */
+ clip_seg.format = GST_FORMAT_TIME;
+ clip_seg.start = bsink->segment.start;
+ clip_seg.stop = bsink->segment.stop;
+ clip_seg.duration = -1;
+
+ /* the sync offset is the combination of ts-offset and device-delay */
+ latency = gst_base_sink_get_latency (bsink);
+ ts_offset = gst_base_sink_get_ts_offset (bsink);
+ render_delay = gst_base_sink_get_render_delay (bsink);
+ sync_offset = ts_offset - render_delay + latency;
+
+ GST_DEBUG_OBJECT (sink,
+ "sync-offset %" G_GINT64_FORMAT ", render-delay %" GST_TIME_FORMAT
+ ", ts-offset %" G_GINT64_FORMAT, sync_offset,
+ GST_TIME_ARGS (render_delay), ts_offset);
+
+ /* compensate for ts-offset and device-delay when negative we need to
+ * clip. */
+ if (sync_offset < 0) {
+ clip_seg.start += -sync_offset;
+ if (clip_seg.stop != -1)
+ clip_seg.stop += -sync_offset;
+ }
+
/* samples should be rendered based on their timestamp. All samples
* arriving before the segment.start or after segment.stop are to be
* thrown away. All samples should also be clipped to the segment
* boundaries */
- /* let's calc stop based on the number of samples in the buffer instead
- * of trusting the DURATION */
- if (!gst_segment_clip (&bsink->segment, GST_FORMAT_TIME, time, stop, &ctime,
+ if (!gst_segment_clip (&clip_seg, GST_FORMAT_TIME, time, stop, &ctime,
&cstop))
goto out_of_segment;
@@ -1129,32 +1383,42 @@
"running: start %" GST_TIME_FORMAT " - stop %" GST_TIME_FORMAT,
GST_TIME_ARGS (render_start), GST_TIME_ARGS (render_stop));
- base_time = gst_element_get_base_time (GST_ELEMENT_CAST (bsink));
+ /* store the time of the last sample, we'll use this to perform sync on the
+ * last sample when draining the buffer */
+ if (bsink->segment.rate >= 0.0) {
+ sink->priv->eos_time = render_stop;
+ } else {
+ sink->priv->eos_time = render_start;
+ }
- GST_DEBUG_OBJECT (sink, "base_time %" GST_TIME_FORMAT,
+ /* compensate for ts-offset and delay we know this will not underflow because we
+ * clipped above. */
+ GST_DEBUG_OBJECT (sink,
+ "compensating for sync-offset %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (sync_offset));
+ render_start += sync_offset;
+ render_stop += sync_offset;
+
+ GST_DEBUG_OBJECT (sink, "adding base_time %" GST_TIME_FORMAT,
GST_TIME_ARGS (base_time));
/* add base time to sync against the clock */
render_start += base_time;
render_stop += base_time;
- /* compensate for latency */
- latency = gst_base_sink_get_latency (bsink);
GST_DEBUG_OBJECT (sink,
- "compensating for latency %" GST_TIME_FORMAT, GST_TIME_ARGS (latency));
-
- /* add latency to get the timestamp to sync against the pipeline clock */
- render_start += latency;
- render_stop += latency;
-
- GST_DEBUG_OBJECT (sink,
- "after latency: start %" GST_TIME_FORMAT " - stop %" GST_TIME_FORMAT,
+ "after compensation: start %" GST_TIME_FORMAT " - stop %" GST_TIME_FORMAT,
GST_TIME_ARGS (render_start), GST_TIME_ARGS (render_stop));
if ((slaved = clock != sink->provided_clock)) {
/* handle clock slaving */
gst_base_audio_sink_handle_slaving (sink, render_start, render_stop,
&render_start, &render_stop);
+ } else {
+ /* no slaving needed but we need to adapt to the clock calibration
+ * parameters */
+ gst_base_audio_sink_none_slaving (sink, render_start, render_stop,
+ &render_start, &render_stop);
}
/* and bring the time to the rate corrected offset in the buffer */
@@ -1163,26 +1427,34 @@
render_stop = gst_util_uint64_scale_int (render_stop,
ringbuf->spec.rate, GST_SECOND);
+ /* positive playback rate, first sample is render_start, negative rate, first
+ * sample is render_stop. When no rate conversion is active, render exactly
+ * the amount of input samples to avoid aligning to rounding errors. */
+ if (bsink->segment.rate >= 0.0) {
+ sample_offset = render_start;
+ if (bsink->segment.rate == 1.0)
+ render_stop = sample_offset + samples;
+ } else {
+ sample_offset = render_stop;
+ if (bsink->segment.rate == -1.0)
+ render_start = sample_offset + samples;
+ }
+
/* always resync after a discont */
if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DISCONT))) {
GST_DEBUG_OBJECT (sink, "resync after discont");
goto no_align;
}
+ /* resync when we don't know what to align the sample with */
if (G_UNLIKELY (sink->next_sample == -1)) {
GST_DEBUG_OBJECT (sink,
"no align possible: no previous sample position known");
goto no_align;
}
- /* positive playback rate, first sample is render_start, negative rate, first
- * sample is render_stop */
- if (bsink->segment.rate >= 1.0)
- sample_offset = render_start;
- else
- sample_offset = render_stop;
-
- /* now try to align the sample to the previous one */
+ /* now try to align the sample to the previous one, first see how big the
+ * difference is. */
if (sample_offset >= sink->next_sample)
diff = sample_offset - sink->next_sample;
else
@@ -1228,7 +1500,7 @@
no_sync:
/* we render the first or last sample first, depending on the rate */
- if (bsink->segment.rate >= 1.0)
+ if (bsink->segment.rate >= 0.0)
sample_offset = render_start;
else
sample_offset = render_stop;
@@ -1250,13 +1522,21 @@
break;
/* else something interrupted us and we wait for preroll. */
- if (gst_base_sink_wait_preroll (bsink) != GST_FLOW_OK)
+ if ((ret = gst_base_sink_wait_preroll (bsink)) != GST_FLOW_OK)
goto stopping;
/* if we got interrupted, we cannot assume that the next sample should
* be aligned to this one */
align_next = FALSE;
+ /* update the output samples. FIXME, this will just skip them when pausing
+ * during trick mode */
+ if (out_samples > written) {
+ out_samples -= written;
+ accum = 0;
+ } else
+ break;
+
samples -= written;
data += written * bps;
} while (TRUE);
@@ -1302,8 +1582,14 @@
}
stopping:
{
- GST_DEBUG_OBJECT (sink, "ringbuffer is stopping");
- return GST_FLOW_WRONG_STATE;
+ GST_DEBUG_OBJECT (sink, "preroll got interrupted: %d (%s)", ret,
+ gst_flow_get_name (ret));
+ return ret;
+ }
+sync_latency_failed:
+ {
+ GST_DEBUG_OBJECT (sink, "failed waiting for latency");
+ return ret;
}
}
@@ -1337,25 +1623,6 @@
return buffer;
}
-static gboolean
-gst_base_audio_sink_activate_pull (GstBaseSink * basesink, gboolean active)
-{
- gboolean ret;
- GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (basesink);
-
- if (active) {
- gst_ring_buffer_set_callback (sink->ringbuffer,
- gst_base_audio_sink_callback, sink);
- ret = gst_ring_buffer_start (sink->ringbuffer);
- } else {
- gst_ring_buffer_set_callback (sink->ringbuffer, NULL, NULL);
- /* stop thread */
- ret = gst_ring_buffer_release (sink->ringbuffer);
- }
-
- return ret;
-}
-
static void
gst_base_audio_sink_callback (GstRingBuffer * rbuf, guint8 * data, guint len,
gpointer user_data)
@@ -1368,11 +1635,15 @@
basesink = GST_BASE_SINK (user_data);
sink = GST_BASE_AUDIO_SINK (user_data);
+ GST_PAD_STREAM_LOCK (basesink->sinkpad);
+
/* would be nice to arrange for pad_alloc_buffer to return data -- as it is we
will copy twice, once into data, once into DMA */
GST_LOG_OBJECT (basesink, "pulling %d bytes offset %" G_GUINT64_FORMAT
" to fill audio buffer", len, basesink->offset);
- ret = gst_pad_pull_range (basesink->sinkpad, basesink->offset, len, &buf);
+ ret =
+ gst_pad_pull_range (basesink->sinkpad, basesink->segment.last_stop, len,
+ &buf);
if (ret != GST_FLOW_OK) {
if (ret == GST_FLOW_UNEXPECTED)
@@ -1381,22 +1652,37 @@
goto error;
}
+ GST_PAD_PREROLL_LOCK (basesink->sinkpad);
+ if (basesink->flushing)
+ goto flushing;
+
+ /* complete preroll and wait for PLAYING */
+ ret = gst_base_sink_do_preroll (basesink, GST_MINI_OBJECT_CAST (buf));
+ if (ret != GST_FLOW_OK)
+ goto preroll_error;
+
if (len != GST_BUFFER_SIZE (buf)) {
- GST_INFO_OBJECT (basesink, "short read pulling from sink pad: %d<%d",
- len, GST_BUFFER_SIZE (buf));
+ GST_INFO_OBJECT (basesink,
+ "got different size than requested from sink pad: %u != %u", len,
+ GST_BUFFER_SIZE (buf));
len = MIN (GST_BUFFER_SIZE (buf), len);
}
- basesink->offset += len;
+ basesink->segment.last_stop += len;
memcpy (data, GST_BUFFER_DATA (buf), len);
+ GST_PAD_PREROLL_UNLOCK (basesink->sinkpad);
+
+ GST_PAD_STREAM_UNLOCK (basesink->sinkpad);
return;
error:
{
- GST_WARNING_OBJECT (basesink, "Got flow error but can't return it: %d",
- ret);
+ GST_WARNING_OBJECT (basesink, "Got flow '%s' but can't return it: %d",
+ gst_flow_get_name (ret), ret);
+ gst_ring_buffer_pause (rbuf);
+ GST_PAD_STREAM_UNLOCK (basesink->sinkpad);
return;
}
eos:
@@ -1405,82 +1691,72 @@
* the sink gets shut down; maybe we should set a flag somewhere, or
* set segment.stop and segment.duration to the last sample or so */
GST_DEBUG_OBJECT (sink, "EOS");
+ gst_base_audio_sink_drain (sink);
+ gst_ring_buffer_pause (rbuf);
gst_element_post_message (GST_ELEMENT_CAST (sink),
gst_message_new_eos (GST_OBJECT_CAST (sink)));
- gst_base_audio_sink_drain (sink);
+ GST_PAD_STREAM_UNLOCK (basesink->sinkpad);
+ }
+flushing:
+ {
+ GST_DEBUG_OBJECT (sink, "we are flushing");
+ gst_ring_buffer_pause (rbuf);
+ GST_PAD_PREROLL_UNLOCK (basesink->sinkpad);
+ GST_PAD_STREAM_UNLOCK (basesink->sinkpad);
+ return;
+ }
+preroll_error:
+ {
+ GST_DEBUG_OBJECT (sink, "error %s", gst_flow_get_name (ret));
+ gst_ring_buffer_pause (rbuf);
+ GST_PAD_PREROLL_UNLOCK (basesink->sinkpad);
+ GST_PAD_STREAM_UNLOCK (basesink->sinkpad);
+ return;
}
}
+static gboolean
+gst_base_audio_sink_activate_pull (GstBaseSink * basesink, gboolean active)
+{
+ gboolean ret;
+ GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (basesink);
+
+ if (active) {
+ GST_DEBUG_OBJECT (basesink, "activating pull");
+
+ gst_ring_buffer_set_callback (sink->ringbuffer,
+ gst_base_audio_sink_callback, sink);
+
+ ret = gst_ring_buffer_activate (sink->ringbuffer, TRUE);
+ } else {
+ GST_DEBUG_OBJECT (basesink, "deactivating pull");
+ gst_ring_buffer_set_callback (sink->ringbuffer, NULL, NULL);
+ ret = gst_ring_buffer_activate (sink->ringbuffer, FALSE);
+ }
+
+ return ret;
+}
+
/* should be called with the LOCK */
static GstStateChangeReturn
gst_base_audio_sink_async_play (GstBaseSink * basesink)
{
- GstClock *clock;
GstBaseAudioSink *sink;
- GstClockTime itime, etime;
- GstClockTime rate_num, rate_denom;
sink = GST_BASE_AUDIO_SINK (basesink);
GST_DEBUG_OBJECT (sink, "ringbuffer may start now");
+ sink->priv->sync_latency = TRUE;
gst_ring_buffer_may_start (sink->ringbuffer, TRUE);
-
- clock = GST_ELEMENT_CLOCK (sink);
- if (clock == NULL)
- goto done;
-
- /* we provided the global clock, don't need to do anything special */
- if (clock == sink->provided_clock)
- goto done;
-
- /* if we are slaved to a clock, we need to set the initial
- * calibration */
- /* get external and internal time to set as calibration params */
- etime = gst_clock_get_time (clock);
- itime = gst_clock_get_internal_time (sink->provided_clock);
-
- sink->priv->avg_skew = -1;
- sink->next_sample = -1;
-
- GST_DEBUG_OBJECT (sink,
- "internal time: %" GST_TIME_FORMAT " external time: %" GST_TIME_FORMAT,
- GST_TIME_ARGS (itime), GST_TIME_ARGS (etime));
-
- gst_clock_get_calibration (sink->provided_clock, NULL, NULL, &rate_num,
- &rate_denom);
- gst_clock_set_calibration (sink->provided_clock, itime, etime,
- rate_num, rate_denom);
-
- switch (sink->priv->slave_method) {
- case GST_BASE_AUDIO_SINK_SLAVE_RESAMPLE:
- /* only set as master if we need to resample */
- GST_DEBUG_OBJECT (sink, "Setting clock as master");
- gst_clock_set_master (sink->provided_clock, clock);
- break;
- default:
- break;
+ if (basesink->pad_mode == GST_ACTIVATE_PULL) {
+ /* we always start the ringbuffer in pull mode immediatly */
+ gst_ring_buffer_start (sink->ringbuffer);
}
- /* start ringbuffer so we can start slaving right away when we need to */
- gst_ring_buffer_start (sink->ringbuffer);
-
-done:
return GST_STATE_CHANGE_SUCCESS;
}
static GstStateChangeReturn
-gst_base_audio_sink_do_play (GstBaseAudioSink * sink)
-{
- GstStateChangeReturn ret;
-
- GST_OBJECT_LOCK (sink);
- ret = gst_base_audio_sink_async_play (GST_BASE_SINK_CAST (sink));
- GST_OBJECT_UNLOCK (sink);
-
- return ret;
-}
-
-static GstStateChangeReturn
gst_base_audio_sink_change_state (GstElement * element,
GstStateChange transition)
{
@@ -1490,6 +1766,7 @@
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
if (sink->ringbuffer == NULL) {
+ gst_audio_clock_reset (GST_AUDIO_CLOCK (sink->provided_clock), 0);
sink->ringbuffer = gst_base_audio_sink_create_ringbuffer (sink);
}
if (!gst_ring_buffer_open_device (sink->ringbuffer))
@@ -1498,19 +1775,29 @@
case GST_STATE_CHANGE_READY_TO_PAUSED:
sink->next_sample = -1;
sink->priv->last_align = -1;
+ sink->priv->eos_time = -1;
gst_ring_buffer_set_flushing (sink->ringbuffer, FALSE);
gst_ring_buffer_may_start (sink->ringbuffer, FALSE);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
- gst_base_audio_sink_do_play (sink);
+ GST_OBJECT_LOCK (sink);
+ GST_DEBUG_OBJECT (sink, "ringbuffer may start now");
+ sink->priv->sync_latency = TRUE;
+ GST_OBJECT_UNLOCK (sink);
+
+ gst_ring_buffer_may_start (sink->ringbuffer, TRUE);
+ if (GST_BASE_SINK_CAST (sink)->pad_mode == GST_ACTIVATE_PULL) {
+ /* we always start the ringbuffer in pull mode immediatly */
+ gst_ring_buffer_start (sink->ringbuffer);
+ }
break;
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
- /* need to take the lock so we don't interfere with an
- * async play */
- GST_OBJECT_LOCK (sink);
/* ringbuffer cannot start anymore */
gst_ring_buffer_may_start (sink->ringbuffer, FALSE);
gst_ring_buffer_pause (sink->ringbuffer);
+
+ GST_OBJECT_LOCK (sink);
+ sink->priv->sync_latency = FALSE;
GST_OBJECT_UNLOCK (sink);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
@@ -1530,6 +1817,7 @@
gst_clock_set_master (sink->provided_clock, NULL);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
+ gst_ring_buffer_activate (sink->ringbuffer, FALSE);
gst_ring_buffer_release (sink->ringbuffer);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
@@ -1537,8 +1825,13 @@
* caps, which happens before we commit the state to PAUSED and thus the
* PAUSED->READY state change (see above, where we release the ringbuffer)
* might not be called when we get here. */
+ gst_ring_buffer_activate (sink->ringbuffer, FALSE);
gst_ring_buffer_release (sink->ringbuffer);
gst_ring_buffer_close_device (sink->ringbuffer);
+ GST_OBJECT_LOCK (sink);
+ gst_object_unparent (GST_OBJECT_CAST (sink->ringbuffer));
+ sink->ringbuffer = NULL;
+ GST_OBJECT_UNLOCK (sink);
break;
default:
break;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosink.h
--- a/gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosink.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosink.h Wed Mar 24 18:04:17 2010 -0500
@@ -85,7 +85,8 @@
* drifts too much.
* @GST_BASE_AUDIO_SINK_SLAVE_NONE: No adjustment is done.
*
- * Different possible clock slaving algorithms
+ * Different possible clock slaving algorithms used when the internal audio
+ * clock is not selected as the pipeline master clock.
*/
typedef enum
{
@@ -94,6 +95,8 @@
GST_BASE_AUDIO_SINK_SLAVE_NONE
} GstBaseAudioSinkSlaveMethod;
+#define GST_TYPE_BASE_AUDIO_SINK_SLAVE_METHOD (gst_base_audio_sink_slave_method_get_type ())
+
typedef struct _GstBaseAudioSink GstBaseAudioSink;
typedef struct _GstBaseAudioSinkClass GstBaseAudioSinkClass;
typedef struct _GstBaseAudioSinkPrivate GstBaseAudioSinkPrivate;
@@ -154,6 +157,11 @@
IMPORT_C
#endif
+GType gst_base_audio_sink_slave_method_get_type (void);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
GstRingBuffer *gst_base_audio_sink_create_ringbuffer (GstBaseAudioSink *sink);
#ifdef __SYMBIAN32__
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosrc.c
--- a/gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosrc.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosrc.c Wed Mar 24 18:04:17 2010 -0500
@@ -42,12 +42,31 @@
#include "gst/gst-i18n-plugin.h"
+GST_DEBUG_CATEGORY_STATIC (gst_base_audio_src_debug);
+#define GST_CAT_DEFAULT gst_base_audio_src_debug
+
#ifdef __SYMBIAN32__
-#include
+EXPORT_C
#endif
-GST_DEBUG_CATEGORY_STATIC (gst_base_audio_src_debug);
-#define GST_CAT_DEFAULT gst_base_audio_src_debug
+GType
+gst_base_audio_src_slave_method_get_type (void)
+{
+ static GType slave_method_type = 0;
+ static const GEnumValue slave_method[] = {
+ {GST_BASE_AUDIO_SRC_SLAVE_RESAMPLE, "Resampling slaving", "resample"},
+ {GST_BASE_AUDIO_SRC_SLAVE_RETIMESTAMP, "Re-timestamp", "re-timestamp"},
+ {GST_BASE_AUDIO_SRC_SLAVE_SKEW, "Skew", "skew"},
+ {GST_BASE_AUDIO_SRC_SLAVE_NONE, "No slaving", "none"},
+ {0, NULL, NULL},
+ };
+
+ if (!slave_method_type) {
+ slave_method_type =
+ g_enum_register_static ("GstBaseAudioSrcSlaveMethod", slave_method);
+ }
+ return slave_method_type;
+}
#define GST_BASE_AUDIO_SRC_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_AUDIO_SRC, GstBaseAudioSrcPrivate))
@@ -55,6 +74,9 @@
struct _GstBaseAudioSrcPrivate
{
gboolean provide_clock;
+
+ /* the clock slaving algorithm in use */
+ GstBaseAudioSrcSlaveMethod slave_method;
};
/* BaseAudioSrc signals and args */
@@ -66,14 +88,21 @@
#define DEFAULT_BUFFER_TIME ((200 * GST_MSECOND) / GST_USECOND)
#define DEFAULT_LATENCY_TIME ((10 * GST_MSECOND) / GST_USECOND)
+#define DEFAULT_ACTUAL_BUFFER_TIME -1
+#define DEFAULT_ACTUAL_LATENCY_TIME -1
#define DEFAULT_PROVIDE_CLOCK TRUE
+#define DEFAULT_SLAVE_METHOD GST_BASE_AUDIO_SRC_SLAVE_RETIMESTAMP
enum
{
PROP_0,
PROP_BUFFER_TIME,
PROP_LATENCY_TIME,
- PROP_PROVIDE_CLOCK
+ PROP_ACTUAL_BUFFER_TIME,
+ PROP_ACTUAL_LATENCY_TIME,
+ PROP_PROVIDE_CLOCK,
+ PROP_SLAVE_METHOD,
+ PROP_LAST
};
static void
@@ -86,6 +115,7 @@
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif /* ENABLE_NLS */
}
@@ -147,17 +177,51 @@
g_object_class_install_property (gobject_class, PROP_BUFFER_TIME,
g_param_spec_int64 ("buffer-time", "Buffer Time",
"Size of audio buffer in microseconds", 1,
- G_MAXINT64, DEFAULT_BUFFER_TIME, G_PARAM_READWRITE));
+ G_MAXINT64, DEFAULT_BUFFER_TIME,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_LATENCY_TIME,
g_param_spec_int64 ("latency-time", "Latency Time",
"Audio latency in microseconds", 1,
- G_MAXINT64, DEFAULT_LATENCY_TIME, G_PARAM_READWRITE));
+ G_MAXINT64, DEFAULT_LATENCY_TIME,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ /**
+ * GstBaseAudioSrc:actual-buffer-time:
+ *
+ * Actual configured size of audio buffer in microseconds.
+ *
+ * Since: 0.10.20
+ **/
+ g_object_class_install_property (gobject_class, PROP_ACTUAL_BUFFER_TIME,
+ g_param_spec_int64 ("actual-buffer-time", "Actual Buffer Time",
+ "Actual configured size of audio buffer in microseconds",
+ DEFAULT_ACTUAL_BUFFER_TIME, G_MAXINT64, DEFAULT_ACTUAL_BUFFER_TIME,
+ G_PARAM_READABLE));
+
+ /**
+ * GstBaseAudioSrc:actual-latency-time:
+ *
+ * Actual configured audio latency in microseconds.
+ *
+ * Since: 0.10.20
+ **/
+ g_object_class_install_property (gobject_class, PROP_ACTUAL_LATENCY_TIME,
+ g_param_spec_int64 ("actual-latency-time", "Actual Latency Time",
+ "Actual configured audio latency in microseconds",
+ DEFAULT_ACTUAL_LATENCY_TIME, G_MAXINT64, DEFAULT_ACTUAL_LATENCY_TIME,
+ G_PARAM_READABLE));
g_object_class_install_property (gobject_class, PROP_PROVIDE_CLOCK,
g_param_spec_boolean ("provide-clock", "Provide Clock",
"Provide a clock to be used as the global pipeline clock",
- DEFAULT_PROVIDE_CLOCK, G_PARAM_READWRITE));
+ DEFAULT_PROVIDE_CLOCK, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (gobject_class, PROP_SLAVE_METHOD,
+ g_param_spec_enum ("slave-method", "Slave Method",
+ "Algorithm to use to match the rate of the masterclock",
+ GST_TYPE_BASE_AUDIO_SRC_SLAVE_METHOD, DEFAULT_SLAVE_METHOD,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_base_audio_src_change_state);
@@ -177,6 +241,7 @@
/* ref class from a thread-safe context to work around missing bit of
* thread-safety in GObject */
g_type_class_ref (GST_TYPE_AUDIO_CLOCK);
+ g_type_class_ref (GST_TYPE_RING_BUFFER);
}
static void
@@ -188,6 +253,7 @@
baseaudiosrc->buffer_time = DEFAULT_BUFFER_TIME;
baseaudiosrc->latency_time = DEFAULT_LATENCY_TIME;
baseaudiosrc->priv->provide_clock = DEFAULT_PROVIDE_CLOCK;
+ baseaudiosrc->priv->slave_method = DEFAULT_SLAVE_METHOD;
/* reset blocksize we use latency time to calculate a more useful
* value based on negotiated format. */
GST_BASE_SRC (baseaudiosrc)->blocksize = 0;
@@ -208,6 +274,7 @@
src = GST_BASE_AUDIO_SRC (object);
+ GST_OBJECT_LOCK (src);
if (src->clock)
gst_object_unref (src->clock);
src->clock = NULL;
@@ -216,6 +283,7 @@
gst_object_unparent (GST_OBJECT_CAST (src->ringbuffer));
src->ringbuffer = NULL;
}
+ GST_OBJECT_UNLOCK (src);
G_OBJECT_CLASS (parent_class)->dispose (object);
}
@@ -350,6 +418,58 @@
return result;
}
+/**
+ * gst_base_audio_src_set_slave_method:
+ * @src: a #GstBaseAudioSrc
+ * @method: the new slave method
+ *
+ * Controls how clock slaving will be performed in @src.
+ *
+ * Since: 0.10.20
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_base_audio_src_set_slave_method (GstBaseAudioSrc * src,
+ GstBaseAudioSrcSlaveMethod method)
+{
+ g_return_if_fail (GST_IS_BASE_AUDIO_SRC (src));
+
+ GST_OBJECT_LOCK (src);
+ src->priv->slave_method = method;
+ GST_OBJECT_UNLOCK (src);
+}
+
+/**
+ * gst_base_audio_src_get_slave_method:
+ * @src: a #GstBaseAudioSrc
+ *
+ * Get the current slave method used by @src.
+ *
+ * Returns: The current slave method used by @src.
+ *
+ * Since: 0.10.20
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstBaseAudioSrcSlaveMethod
+gst_base_audio_src_get_slave_method (GstBaseAudioSrc * src)
+{
+ GstBaseAudioSrcSlaveMethod result;
+
+ g_return_val_if_fail (GST_IS_BASE_AUDIO_SRC (src), -1);
+
+ GST_OBJECT_LOCK (src);
+ result = src->priv->slave_method;
+ GST_OBJECT_UNLOCK (src);
+
+ return result;
+}
+
static void
gst_base_audio_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
@@ -368,6 +488,9 @@
case PROP_PROVIDE_CLOCK:
gst_base_audio_src_set_provide_clock (src, g_value_get_boolean (value));
break;
+ case PROP_SLAVE_METHOD:
+ gst_base_audio_src_set_slave_method (src, g_value_get_enum (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -389,9 +512,28 @@
case PROP_LATENCY_TIME:
g_value_set_int64 (value, src->latency_time);
break;
+ case PROP_ACTUAL_BUFFER_TIME:
+ GST_OBJECT_LOCK (src);
+ if (src->ringbuffer && src->ringbuffer->acquired)
+ g_value_set_int64 (value, src->ringbuffer->spec.buffer_time);
+ else
+ g_value_set_int64 (value, DEFAULT_ACTUAL_BUFFER_TIME);
+ GST_OBJECT_UNLOCK (src);
+ break;
+ case PROP_ACTUAL_LATENCY_TIME:
+ GST_OBJECT_LOCK (src);
+ if (src->ringbuffer && src->ringbuffer->acquired)
+ g_value_set_int64 (value, src->ringbuffer->spec.latency_time);
+ else
+ g_value_set_int64 (value, DEFAULT_ACTUAL_LATENCY_TIME);
+ GST_OBJECT_UNLOCK (src);
+ break;
case PROP_PROVIDE_CLOCK:
g_value_set_boolean (value, gst_base_audio_src_get_provide_clock (src));
break;
+ case PROP_SLAVE_METHOD:
+ g_value_set_enum (value, gst_base_audio_src_get_slave_method (src));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -463,6 +605,9 @@
gst_ring_buffer_debug_spec_buff (spec);
+ g_object_notify (G_OBJECT (src), "actual-buffer-time");
+ g_object_notify (G_OBJECT (src), "actual-latency-time");
+
return TRUE;
/* ERRORS */
@@ -538,21 +683,31 @@
gst_base_audio_src_event (GstBaseSrc * bsrc, GstEvent * event)
{
GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (bsrc);
+ gboolean res;
+
+ res = TRUE;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
+ GST_DEBUG_OBJECT (bsrc, "flush-start");
gst_ring_buffer_pause (src->ringbuffer);
gst_ring_buffer_clear_all (src->ringbuffer);
break;
case GST_EVENT_FLUSH_STOP:
+ GST_DEBUG_OBJECT (bsrc, "flush-stop");
/* always resync on sample after a flush */
src->next_sample = -1;
gst_ring_buffer_clear_all (src->ringbuffer);
break;
+ case GST_EVENT_SEEK:
+ GST_DEBUG_OBJECT (bsrc, "refuse to seek");
+ res = FALSE;
+ break;
default:
+ GST_DEBUG_OBJECT (bsrc, "dropping event %p", event);
break;
}
- return TRUE;
+ return res;
}
/* get the next offset in the ringbuffer for reading samples.
@@ -591,7 +746,7 @@
if (diff >= segtotal) {
GST_DEBUG_OBJECT (src, "dropped, align to segment %d", segdone);
/* sample would be dropped, position to next playable position */
- sample = (segdone - segtotal + 1) * sps;
+ sample = ((guint64) (segdone)) * sps;
}
return sample;
@@ -677,7 +832,9 @@
G_GUINT64_FORMAT, sample - src->next_sample, sample);
GST_ELEMENT_WARNING (src, CORE, CLOCK,
(_("Can't record audio fast enough")),
- ("dropped %" G_GUINT64_FORMAT " samples", sample - src->next_sample));
+ ("Dropped %" G_GUINT64_FORMAT " samples. This is most likely because "
+ "downstream can't keep up and is consuming samples too slowly.",
+ sample - src->next_sample));
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
}
@@ -689,28 +846,179 @@
spec->rate) - timestamp;
GST_OBJECT_LOCK (src);
- clock = GST_ELEMENT_CLOCK (src);
- if (clock != NULL && clock != src->clock) {
- GstClockTime base_time, latency;
+ if (!(clock = GST_ELEMENT_CLOCK (src)))
+ goto no_sync;
+
+ if (clock != src->clock) {
+ /* we are slaved, check how to handle this */
+ switch (src->priv->slave_method) {
+ case GST_BASE_AUDIO_SRC_SLAVE_RESAMPLE:
+ /* not implemented, use skew algorithm. This algorithm should
+ * work on the readout pointer and produces more or less samples based
+ * on the clock drift */
+ case GST_BASE_AUDIO_SRC_SLAVE_SKEW:
+ {
+ GstClockTime running_time;
+ GstClockTime base_time;
+ GstClockTime current_time;
+ guint64 running_time_sample;
+ gint running_time_segment;
+ gint current_segment;
+ gint segment_skew;
+ gint sps;
+
+ /* samples per segment */
+ sps = ringbuffer->samples_per_seg;
+
+ /* get the current time */
+ current_time = gst_clock_get_time (clock);
+
+ /* get the basetime */
+ base_time = GST_ELEMENT_CAST (src)->base_time;
+
+ /* get the running_time */
+ running_time = current_time - base_time;
+
+ /* the running_time converted to a sample (relative to the ringbuffer) */
+ running_time_sample =
+ gst_util_uint64_scale_int (running_time, spec->rate, GST_SECOND);
+
+ /* the segmentnr corrensponding to running_time, round down */
+ running_time_segment = running_time_sample / sps;
+
+ /* the segment currently read from the ringbuffer */
+ current_segment = sample / sps;
+
+ /* the skew we have between running_time and the ringbuffertime */
+ segment_skew = running_time_segment - current_segment;
+
+ GST_DEBUG_OBJECT (bsrc, "\n running_time = %" GST_TIME_FORMAT
+ "\n timestamp = %" GST_TIME_FORMAT
+ "\n running_time_segment = %d"
+ "\n current_segment = %d"
+ "\n segment_skew = %d",
+ GST_TIME_ARGS (running_time),
+ GST_TIME_ARGS (timestamp),
+ running_time_segment, current_segment, segment_skew);
- /* We are slaved to another clock, take running time of the clock and just
- * timestamp against it. Somebody else in the pipeline should figure out the
- * clock drift, for now. We keep the duration we calculated above. */
- timestamp = gst_clock_get_time (clock);
+ /* Resync the ringbuffer if:
+ * 1. We get one segment into the future.
+ * This is clearly a lie, because we can't
+ * possibly have a buffer with timestamp 1 at
+ * time 0. (unless it has time-travelled...)
+ *
+ * 2. We are more than the length of the ringbuffer behind.
+ * The length of the ringbuffer then gets to dictate
+ * the threshold for what is concidered "too late"
+ *
+ * 3. If this is our first buffer.
+ * We know that we should catch up to running_time
+ * the first time we are ran.
+ */
+ if ((segment_skew < 0) ||
+ (segment_skew >= ringbuffer->spec.segtotal) ||
+ (current_segment == 0)) {
+ gint segments_written;
+ gint first_segment;
+ gint last_segment;
+ gint new_last_segment;
+ gint segment_diff;
+ gint new_first_segment;
+ guint64 new_sample;
+
+ /* we are going to say that the last segment was captured at the current time
+ (running_time), minus one segment of creation-latency in the ringbuffer.
+ This can be thought of as: The segment arrived in the ringbuffer at time X, and
+ that means it was created at time X - (one segment). */
+ new_last_segment = running_time_segment - 1;
+
+ /* for better readablity */
+ first_segment = current_segment;
+
+ /* get the amount of segments written from the device by now */
+ segments_written = g_atomic_int_get (&ringbuffer->segdone);
+
+ /* subtract the base to segments_written to get the number of the
+ last written segment in the ringbuffer (one segment written = segment 0) */
+ last_segment = segments_written - ringbuffer->segbase - 1;
+
+ /* we see how many segments the ringbuffer was timeshifted */
+ segment_diff = new_last_segment - last_segment;
+
+ /* we move the first segment an equal amount */
+ new_first_segment = first_segment + segment_diff;
+
+ /* and we also move the segmentbase the same amount */
+ ringbuffer->segbase -= segment_diff;
+
+ /* we calculate the new sample value */
+ new_sample = ((guint64) new_first_segment) * sps;
+
+ /* and get the relative time to this -> our new timestamp */
+ timestamp =
+ gst_util_uint64_scale_int (new_sample, GST_SECOND, spec->rate);
+
+ /* we update the next sample accordingly */
+ src->next_sample = new_sample + samples;
+
+ GST_DEBUG_OBJECT (bsrc,
+ "Timeshifted the ringbuffer with %d segments: "
+ "Updating the timestamp to %" GST_TIME_FORMAT ", "
+ "and src->next_sample to %" G_GUINT64_FORMAT, segment_diff,
+ GST_TIME_ARGS (timestamp), src->next_sample);
+ }
+ break;
+ }
+ case GST_BASE_AUDIO_SRC_SLAVE_RETIMESTAMP:
+ {
+ GstClockTime base_time, latency;
+
+ /* We are slaved to another clock, take running time of the pipeline clock and
+ * timestamp against it. Somebody else in the pipeline should figure out the
+ * clock drift. We keep the duration we calculated above. */
+ timestamp = gst_clock_get_time (clock);
+ base_time = GST_ELEMENT_CAST (src)->base_time;
+
+ if (timestamp > base_time)
+ timestamp -= base_time;
+ else
+ timestamp = 0;
+
+ /* subtract latency */
+ latency =
+ gst_util_uint64_scale_int (total_samples, GST_SECOND, spec->rate);
+ if (timestamp > latency)
+ timestamp -= latency;
+ else
+ timestamp = 0;
+ }
+ case GST_BASE_AUDIO_SRC_SLAVE_NONE:
+ break;
+ }
+ } else {
+ GstClockTime base_time;
+
+ /* to get the timestamp against the clock we also need to add our offset */
+ timestamp = gst_audio_clock_adjust (clock, timestamp);
+
+ /* we are not slaved, subtract base_time */
base_time = GST_ELEMENT_CAST (src)->base_time;
- if (timestamp > base_time)
+ if (timestamp > base_time) {
timestamp -= base_time;
- else
+ GST_LOG_OBJECT (src,
+ "buffer timestamp %" GST_TIME_FORMAT " (base_time %" GST_TIME_FORMAT
+ ")", GST_TIME_ARGS (timestamp), GST_TIME_ARGS (base_time));
+ } else {
+ GST_LOG_OBJECT (src,
+ "buffer timestamp 0, ts %" GST_TIME_FORMAT " <= base_time %"
+ GST_TIME_FORMAT, GST_TIME_ARGS (timestamp),
+ GST_TIME_ARGS (base_time));
timestamp = 0;
+ }
+ }
- /* subtract latency */
- latency = gst_util_uint64_scale_int (total_samples, GST_SECOND, spec->rate);
- if (timestamp > latency)
- timestamp -= latency;
- else
- timestamp = 0;
- }
+no_sync:
GST_OBJECT_UNLOCK (src);
GST_BUFFER_TIMESTAMP (buf) = timestamp;
@@ -718,8 +1026,6 @@
GST_BUFFER_OFFSET (buf) = sample;
GST_BUFFER_OFFSET_END (buf) = sample + samples;
- gst_buffer_set_caps (buf, GST_PAD_CAPS (GST_BASE_SRC_PAD (bsrc)));
-
*outbuf = buf;
return GST_FLOW_OK;
@@ -785,9 +1091,12 @@
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
GST_DEBUG_OBJECT (src, "NULL->READY");
+ GST_OBJECT_LOCK (src);
if (src->ringbuffer == NULL) {
+ gst_audio_clock_reset (GST_AUDIO_CLOCK (src->clock), 0);
src->ringbuffer = gst_base_audio_src_create_ringbuffer (src);
}
+ GST_OBJECT_UNLOCK (src);
if (!gst_ring_buffer_open_device (src->ringbuffer))
goto open_failed;
break;
@@ -824,8 +1133,10 @@
case GST_STATE_CHANGE_READY_TO_NULL:
GST_DEBUG_OBJECT (src, "READY->NULL");
gst_ring_buffer_close_device (src->ringbuffer);
+ GST_OBJECT_LOCK (src);
gst_object_unparent (GST_OBJECT_CAST (src->ringbuffer));
src->ringbuffer = NULL;
+ GST_OBJECT_UNLOCK (src);
break;
default:
break;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosrc.h
--- a/gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosrc.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstbaseaudiosrc.h Wed Mar 24 18:04:17 2010 -0500
@@ -60,6 +60,28 @@
typedef struct _GstBaseAudioSrcPrivate GstBaseAudioSrcPrivate;
/**
+ * GstBaseAudioSrcSlaveMethod:
+ * @GST_BASE_AUDIO_SRC_SLAVE_RESAMPLE: Resample to match the master clock.
+ * @GST_BASE_AUDIO_SRC_SLAVE_RETIMESTAMP: Retimestamp output buffers with master
+ * clock time.
+ * @GST_BASE_AUDIO_SRC_SLAVE_SKEW: Adjust capture pointer when master clock
+ * drifts too much.
+ * @GST_BASE_AUDIO_SRC_SLAVE_NONE: No adjustment is done.
+ *
+ * Different possible clock slaving algorithms when the internal audio clock was
+ * not selected as the pipeline clock.
+ */
+typedef enum
+{
+ GST_BASE_AUDIO_SRC_SLAVE_RESAMPLE,
+ GST_BASE_AUDIO_SRC_SLAVE_RETIMESTAMP,
+ GST_BASE_AUDIO_SRC_SLAVE_SKEW,
+ GST_BASE_AUDIO_SRC_SLAVE_NONE
+} GstBaseAudioSrcSlaveMethod;
+
+#define GST_TYPE_BASE_AUDIO_SRC_SLAVE_METHOD (gst_base_audio_src_slave_method_get_type ())
+
+/**
* GstBaseAudioSrc:
*
* Opaque #GstBaseAudioSrc.
@@ -114,6 +136,11 @@
IMPORT_C
#endif
+GType gst_base_audio_src_slave_method_get_type (void);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
GstRingBuffer *gst_base_audio_src_create_ringbuffer (GstBaseAudioSrc *src);
#ifdef __SYMBIAN32__
@@ -127,6 +154,20 @@
#endif
gboolean gst_base_audio_src_get_provide_clock (GstBaseAudioSrc *src);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+void gst_base_audio_src_set_slave_method (GstBaseAudioSrc *src,
+ GstBaseAudioSrcSlaveMethod method);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+GstBaseAudioSrcSlaveMethod
+ gst_base_audio_src_get_slave_method (GstBaseAudioSrc *src);
+
G_END_DECLS
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstringbuffer.c
--- a/gst_plugins_base/gst-libs/gst/audio/gstringbuffer.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstringbuffer.c Wed Mar 24 18:04:17 2010 -0500
@@ -43,10 +43,6 @@
#include "gstringbuffer.h"
-#ifdef __SYMBIAN32__
-#include
-#endif
-
GST_DEBUG_CATEGORY_STATIC (gst_ring_buffer_debug);
#define GST_CAT_DEFAULT gst_ring_buffer_debug
@@ -56,6 +52,9 @@
static void gst_ring_buffer_finalize (GObject * object);
static gboolean gst_ring_buffer_pause_unlocked (GstRingBuffer * buf);
+static void default_clear_all (GstRingBuffer * buf);
+static guint default_commit (GstRingBuffer * buf, guint64 * sample,
+ guchar * data, gint in_samples, gint out_samples, gint * accum);
static GstObjectClass *parent_class = NULL;
@@ -97,14 +96,19 @@
{
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
+ GstRingBufferClass *gstringbuffer_class;
gobject_class = (GObjectClass *) klass;
gstobject_class = (GstObjectClass *) klass;
+ gstringbuffer_class = (GstRingBufferClass *) klass;
parent_class = g_type_class_peek_parent (klass);
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_ring_buffer_dispose);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_ring_buffer_finalize);
+
+ gstringbuffer_class->clear_all = GST_DEBUG_FUNCPTR (default_clear_all);
+ gstringbuffer_class->commit = GST_DEBUG_FUNCPTR (default_commit);
}
static void
@@ -274,6 +278,7 @@
GST_DEBUG ("acquire ringbuffer: latency time: %" G_GINT64_FORMAT " usec",
spec->latency_time);
GST_DEBUG ("acquire ringbuffer: total segments: %d", spec->segtotal);
+ GST_DEBUG ("acquire ringbuffer: latency segments: %d", spec->seglatency);
GST_DEBUG ("acquire ringbuffer: segment size: %d bytes = %d samples",
spec->segsize, spec->segsize / spec->bytes_per_sample);
GST_DEBUG ("acquire ringbuffer: buffer size: %d bytes = %d samples",
@@ -434,6 +439,9 @@
spec->segsize -= spec->segsize % spec->bytes_per_sample;
spec->segtotal = spec->buffer_time / spec->latency_time;
+ /* leave the latency undefined now, implementations can change it but if it's
+ * not changed, we assume the same value as segtotal */
+ spec->seglatency = -1;
gst_ring_buffer_debug_spec_caps (spec);
gst_ring_buffer_debug_spec_buff (spec);
@@ -449,6 +457,105 @@
}
/**
+ * gst_ring_buffer_convert:
+ * @buf: the #GstRingBuffer
+ * @src_fmt: the source format
+ * @src_val: the source value
+ * @dest_fmt: the destination format
+ * @dest_val: a location to store the converted value
+ *
+ * Convert @src_val in @src_fmt to the equivalent value in @dest_fmt. The result
+ * will be put in @dest_val.
+ *
+ * Returns: TRUE if the conversion succeeded.
+ *
+ * Since: 0.10.22.
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_ring_buffer_convert (GstRingBuffer * buf,
+ GstFormat src_fmt, gint64 src_val, GstFormat dest_fmt, gint64 * dest_val)
+{
+ gboolean res = TRUE;
+ gint bps, rate;
+
+ GST_DEBUG ("converting value %" G_GINT64_FORMAT " from %s (%d) to %s (%d)",
+ src_val, gst_format_get_name (src_fmt), src_fmt,
+ gst_format_get_name (dest_fmt), dest_fmt);
+
+ if (src_fmt == dest_fmt || src_val == -1) {
+ *dest_val = src_val;
+ goto done;
+ }
+
+ /* get important info */
+ GST_OBJECT_LOCK (buf);
+ bps = buf->spec.bytes_per_sample;
+ rate = buf->spec.rate;
+ GST_OBJECT_UNLOCK (buf);
+
+ if (bps == 0 || rate == 0) {
+ GST_DEBUG ("no rate or bps configured");
+ res = FALSE;
+ goto done;
+ }
+
+ switch (src_fmt) {
+ case GST_FORMAT_BYTES:
+ switch (dest_fmt) {
+ case GST_FORMAT_TIME:
+ *dest_val = gst_util_uint64_scale_int (src_val / bps, GST_SECOND,
+ rate);
+ break;
+ case GST_FORMAT_DEFAULT:
+ *dest_val = src_val / bps;
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ case GST_FORMAT_DEFAULT:
+ switch (dest_fmt) {
+ case GST_FORMAT_TIME:
+ *dest_val = gst_util_uint64_scale_int (src_val, GST_SECOND, rate);
+ break;
+ case GST_FORMAT_BYTES:
+ *dest_val = src_val * bps;
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ case GST_FORMAT_TIME:
+ switch (dest_fmt) {
+ case GST_FORMAT_DEFAULT:
+ *dest_val = gst_util_uint64_scale_int (src_val, rate, GST_SECOND);
+ break;
+ case GST_FORMAT_BYTES:
+ *dest_val = gst_util_uint64_scale_int (src_val, rate, GST_SECOND);
+ *dest_val *= bps;
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+done:
+ GST_DEBUG ("ret=%d result %" G_GINT64_FORMAT, res, *dest_val);
+
+ return res;
+}
+
+/**
* gst_ring_buffer_set_callback:
* @buf: the #GstRingBuffer to set the callback on
* @cb: the callback to set
@@ -640,7 +747,6 @@
return res;
}
-
/**
* gst_ring_buffer_acquire:
* @buf: the #GstRingBuffer to acquire
@@ -689,6 +795,11 @@
if (G_UNLIKELY ((bps = buf->spec.bytes_per_sample) == 0))
goto invalid_bps;
+ /* if the seglatency was overwritten with something else than -1, use it, else
+ * assume segtotal as the latency */
+ if (buf->spec.seglatency == -1)
+ buf->spec.seglatency = buf->spec.segtotal;
+
segsize = buf->spec.segsize;
buf->samples_per_seg = segsize / bps;
@@ -840,6 +951,111 @@
}
/**
+ * gst_ring_buffer_activate:
+ * @buf: the #GstRingBuffer to activate
+ * @active: the new mode
+ *
+ * Activate @buf to start or stop pulling data.
+ *
+ * MT safe.
+ *
+ * Returns: TRUE if the device could be activated in the requested mode,
+ * FALSE on error.
+ *
+ * Since: 0.10.22.
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_ring_buffer_activate (GstRingBuffer * buf, gboolean active)
+{
+ gboolean res = FALSE;
+ GstRingBufferClass *rclass;
+
+ g_return_val_if_fail (GST_IS_RING_BUFFER (buf), FALSE);
+
+ GST_DEBUG_OBJECT (buf, "activate device");
+
+ GST_OBJECT_LOCK (buf);
+ if (G_UNLIKELY (active && !buf->acquired))
+ goto not_acquired;
+
+ if (G_UNLIKELY (buf->abidata.ABI.active == active))
+ goto was_active;
+
+ rclass = GST_RING_BUFFER_GET_CLASS (buf);
+ /* if there is no activate function we assume it was started/released
+ * in the acquire method */
+ if (G_LIKELY (rclass->activate))
+ res = rclass->activate (buf, active);
+ else
+ res = TRUE;
+
+ if (G_UNLIKELY (!res))
+ goto activate_failed;
+
+ buf->abidata.ABI.active = active;
+
+done:
+ GST_OBJECT_UNLOCK (buf);
+
+ return res;
+
+ /* ERRORS */
+not_acquired:
+ {
+ GST_DEBUG_OBJECT (buf, "device not acquired");
+ g_critical ("Device for %p not acquired", buf);
+ res = FALSE;
+ goto done;
+ }
+was_active:
+ {
+ res = TRUE;
+ GST_DEBUG_OBJECT (buf, "device was active in mode %d", active);
+ goto done;
+ }
+activate_failed:
+ {
+ GST_DEBUG_OBJECT (buf, "failed to activate device");
+ goto done;
+ }
+}
+
+/**
+ * gst_ring_buffer_is_active:
+ * @buf: the #GstRingBuffer
+ *
+ * Check if @buf is activated.
+ *
+ * MT safe.
+ *
+ * Returns: TRUE if the device is active.
+ *
+ * Since: 0.10.22.
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_ring_buffer_is_active (GstRingBuffer * buf)
+{
+ gboolean res;
+
+ g_return_val_if_fail (GST_IS_RING_BUFFER (buf), FALSE);
+
+ GST_OBJECT_LOCK (buf);
+ res = buf->abidata.ABI.active;
+ GST_OBJECT_UNLOCK (buf);
+
+ return res;
+}
+
+
+/**
* gst_ring_buffer_set_flushing:
* @buf: the #GstRingBuffer to flush
* @flushing: the new mode
@@ -860,9 +1076,10 @@
GST_OBJECT_LOCK (buf);
buf->abidata.ABI.flushing = flushing;
- gst_ring_buffer_clear_all (buf);
if (flushing) {
gst_ring_buffer_pause_unlocked (buf);
+ } else {
+ gst_ring_buffer_clear_all (buf);
}
GST_OBJECT_UNLOCK (buf);
}
@@ -904,13 +1121,14 @@
GST_RING_BUFFER_STATE_STOPPED, GST_RING_BUFFER_STATE_STARTED);
if (!res) {
+ GST_DEBUG_OBJECT (buf, "was not stopped, try paused");
/* was not stopped, try from paused */
res = g_atomic_int_compare_and_exchange (&buf->state,
GST_RING_BUFFER_STATE_PAUSED, GST_RING_BUFFER_STATE_STARTED);
if (!res) {
/* was not paused either, must be started then */
res = TRUE;
- GST_DEBUG_OBJECT (buf, "was started");
+ GST_DEBUG_OBJECT (buf, "was not paused, must have been started");
goto done;
}
resume = TRUE;
@@ -1071,10 +1289,16 @@
GST_RING_BUFFER_STATE_STARTED, GST_RING_BUFFER_STATE_STOPPED);
if (!res) {
- /* was not started, must be stopped then */
- GST_DEBUG_OBJECT (buf, "was not started");
- res = TRUE;
- goto done;
+ GST_DEBUG_OBJECT (buf, "was not started, try paused");
+ /* was not started, try from paused */
+ res = g_atomic_int_compare_and_exchange (&buf->state,
+ GST_RING_BUFFER_STATE_PAUSED, GST_RING_BUFFER_STATE_STOPPED);
+ if (!res) {
+ /* was not paused either, must have been stopped then */
+ res = TRUE;
+ GST_DEBUG_OBJECT (buf, "was not paused, must have been stopped");
+ goto done;
+ }
}
/* signal any waiters */
@@ -1220,6 +1444,22 @@
buf->segbase);
}
+static void
+default_clear_all (GstRingBuffer * buf)
+{
+ gint i;
+
+ /* not fatal, we just are not negotiated yet */
+ if (G_UNLIKELY (buf->spec.segtotal <= 0))
+ return;
+
+ GST_DEBUG_OBJECT (buf, "clear all segments");
+
+ for (i = 0; i < buf->spec.segtotal; i++) {
+ gst_ring_buffer_clear (buf, i);
+ }
+}
+
/**
* gst_ring_buffer_clear_all:
* @buf: the #GstRingBuffer to clear
@@ -1235,19 +1475,14 @@
void
gst_ring_buffer_clear_all (GstRingBuffer * buf)
{
- gint i;
+ GstRingBufferClass *rclass;
g_return_if_fail (GST_IS_RING_BUFFER (buf));
- /* not fatal, we just are not negotiated yet */
- if (G_UNLIKELY (buf->spec.segtotal <= 0))
- return;
+ rclass = GST_RING_BUFFER_GET_CLASS (buf);
- GST_DEBUG_OBJECT (buf, "clear all segments");
-
- for (i = 0; i < buf->spec.segtotal; i++) {
- gst_ring_buffer_clear (buf, i);
- }
+ if (G_LIKELY (rclass->clear_all))
+ rclass->clear_all (buf);
}
@@ -1370,7 +1605,7 @@
memcpy (d, se, bps); \
se -= bps; \
*accum += outr; \
- while ((*accum << 1) >= inr) { \
+ while (d < de && (*accum << 1) >= inr) { \
*accum -= inr; \
d += bps; \
} \
@@ -1388,7 +1623,7 @@
memcpy (d, se, bps); \
d += bps; \
*accum += inr; \
- while ((*accum << 1) >= outr) { \
+ while (s <= se && (*accum << 1) >= outr) { \
*accum -= outr; \
se -= bps; \
} \
@@ -1398,47 +1633,8 @@
GST_DEBUG ("rev_down end %d/%d",*accum,*toprocess); \
} G_STMT_END
-/**
- * gst_ring_buffer_commit_full:
- * @buf: the #GstRingBuffer to commit
- * @sample: the sample position of the data
- * @data: the data to commit
- * @in_samples: the number of samples in the data to commit
- * @out_samples: the number of samples to write to the ringbuffer
- * @accum: accumulator for rate conversion.
- *
- * Commit @in_samples samples pointed to by @data to the ringbuffer @buf.
- *
- * @in_samples and @out_samples define the rate conversion to perform on the the
- * samples in @data. For negative rates, @out_samples must be negative and
- * @in_samples positive.
- *
- * When @out_samples is positive, the first sample will be written at position @sample
- * in the ringbuffer. When @out_samples is negative, the last sample will be written to
- * @sample in reverse order.
- *
- * @out_samples does not need to be a multiple of the segment size of the ringbuffer
- * although it is recommended for optimal performance.
- *
- * @accum will hold a temporary accumulator used in rate conversion and should be
- * set to 0 when this function is first called. In case the commit operation is
- * interrupted, one can resume the processing by passing the previously returned
- * @accum value back to this function.
- *
- * Returns: The number of samples written to the ringbuffer or -1 on error. The
- * number of samples written can be less than @out_samples when @buf was interrupted
- * with a flush or stop.
- *
- * Since: 0.10.11.
- *
- * MT safe.
- */
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-guint
-gst_ring_buffer_commit_full (GstRingBuffer * buf, guint64 * sample,
+static guint
+default_commit (GstRingBuffer * buf, guint64 * sample,
guchar * data, gint in_samples, gint out_samples, gint * accum)
{
gint segdone;
@@ -1449,10 +1645,6 @@
gint inr, outr;
gboolean reverse;
- if (G_UNLIKELY (in_samples == 0 || out_samples == 0))
- return in_samples;
-
- g_return_val_if_fail (GST_IS_RING_BUFFER (buf), -1);
g_return_val_if_fail (buf->data != NULL, -1);
g_return_val_if_fail (data != NULL, -1);
@@ -1571,6 +1763,65 @@
}
/**
+ * gst_ring_buffer_commit_full:
+ * @buf: the #GstRingBuffer to commit
+ * @sample: the sample position of the data
+ * @data: the data to commit
+ * @in_samples: the number of samples in the data to commit
+ * @out_samples: the number of samples to write to the ringbuffer
+ * @accum: accumulator for rate conversion.
+ *
+ * Commit @in_samples samples pointed to by @data to the ringbuffer @buf.
+ *
+ * @in_samples and @out_samples define the rate conversion to perform on the the
+ * samples in @data. For negative rates, @out_samples must be negative and
+ * @in_samples positive.
+ *
+ * When @out_samples is positive, the first sample will be written at position @sample
+ * in the ringbuffer. When @out_samples is negative, the last sample will be written to
+ * @sample in reverse order.
+ *
+ * @out_samples does not need to be a multiple of the segment size of the ringbuffer
+ * although it is recommended for optimal performance.
+ *
+ * @accum will hold a temporary accumulator used in rate conversion and should be
+ * set to 0 when this function is first called. In case the commit operation is
+ * interrupted, one can resume the processing by passing the previously returned
+ * @accum value back to this function.
+ *
+ * MT safe.
+ *
+ * Returns: The number of samples written to the ringbuffer or -1 on error. The
+ * number of samples written can be less than @out_samples when @buf was interrupted
+ * with a flush or stop.
+ *
+ * Since: 0.10.11.
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+guint
+gst_ring_buffer_commit_full (GstRingBuffer * buf, guint64 * sample,
+ guchar * data, gint in_samples, gint out_samples, gint * accum)
+{
+ GstRingBufferClass *rclass;
+ guint res = -1;
+
+ g_return_val_if_fail (GST_IS_RING_BUFFER (buf), -1);
+
+ if (G_UNLIKELY (in_samples == 0 || out_samples == 0))
+ return in_samples;
+
+ rclass = GST_RING_BUFFER_GET_CLASS (buf);
+
+ if (G_LIKELY (rclass->commit))
+ res = rclass->commit (buf, sample, data, in_samples, out_samples, accum);
+
+ return res;
+}
+
+/**
* gst_ring_buffer_commit:
* @buf: the #GstRingBuffer to commit
* @sample: the sample position of the data
@@ -1742,10 +1993,6 @@
g_return_val_if_fail (GST_IS_RING_BUFFER (buf), FALSE);
- /* buffer must be started */
- if (g_atomic_int_get (&buf->state) != GST_RING_BUFFER_STATE_STARTED)
- return FALSE;
-
g_return_val_if_fail (buf->data != NULL, FALSE);
g_return_val_if_fail (segment != NULL, FALSE);
g_return_val_if_fail (readptr != NULL, FALSE);
@@ -1753,6 +2000,12 @@
data = GST_BUFFER_DATA (buf->data);
+ if (buf->callback == NULL) {
+ /* push mode, fail when nothing is started */
+ if (g_atomic_int_get (&buf->state) != GST_RING_BUFFER_STATE_STARTED)
+ return FALSE;
+ }
+
/* get the position of the pointer */
segdone = g_atomic_int_get (&buf->segdone);
@@ -1760,14 +2013,14 @@
*len = buf->spec.segsize;
*readptr = data + *segment * *len;
+ GST_LOG ("prepare read from segment %d (real %d) @%p",
+ *segment, segdone, *readptr);
+
/* callback to fill the memory with data, for pull based
* scheduling. */
if (buf->callback)
buf->callback (buf, *readptr, *len, buf->cb_data);
- GST_LOG ("prepare read from segment %d (real %d) @%p",
- *segment, segdone, *readptr);
-
return TRUE;
}
@@ -1851,9 +2104,9 @@
* Tell the ringbuffer that it is allowed to start playback when
* the ringbuffer is filled with samples.
*
- * Since: 0.10.6
+ * MT safe.
*
- * MT safe.
+ * Since: 0.10.6
*/
#ifdef __SYMBIAN32__
EXPORT_C
@@ -1865,5 +2118,5 @@
g_return_if_fail (GST_IS_RING_BUFFER (buf));
GST_LOG_OBJECT (buf, "may start: %d", allowed);
- gst_atomic_int_set (&buf->abidata.ABI.may_start, allowed);
+ g_atomic_int_set (&buf->abidata.ABI.may_start, allowed);
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/gstringbuffer.h
--- a/gst_plugins_base/gst-libs/gst/audio/gstringbuffer.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/gstringbuffer.h Wed Mar 24 18:04:17 2010 -0500
@@ -181,6 +181,8 @@
* @segtotal: the total number of segments
* @bytes_per_sample: number of bytes in one sample
* @silence_sample: bytes representing one sample of silence
+ * @seglatency: number of segments queued in the lower level device,
+ * defaults to segtotal
*
* The structure containing the format specification of the ringbuffer.
*/
@@ -200,17 +202,30 @@
gint rate;
gint channels;
- guint64 latency_time; /* the required/actual latency time */
- guint64 buffer_time; /* the required/actual time of the buffer */
- gint segsize; /* size of one buffer segment in bytes */
- gint segtotal; /* total number of segments */
-
+ guint64 latency_time; /* the required/actual latency time, this is the
+ * actual the size of one segment and the
+ * minimum possible latency we can achieve. */
+ guint64 buffer_time; /* the required/actual time of the buffer, this is
+ * the total size of the buffer and maximum
+ * latency we can compensate for. */
+ gint segsize; /* size of one buffer segment in bytes, this value
+ * should be chosen to match latency_time as
+ * well as possible. */
+ gint segtotal; /* total number of segments, this value is the
+ * number of segments of @segsize and should be
+ * chosen so that it matches buffer_time as
+ * close as possible. */
/* out */
gint bytes_per_sample; /* number of bytes of one sample */
guint8 silence_sample[32]; /* bytes representing silence */
+ /* ABI added 0.10.20 */
+ gint seglatency; /* number of segments queued in the lower
+ * level device, defaults to segtotal. */
+
/*< private >*/
- gpointer _gst_reserved[GST_PADDING];
+ /* gpointer _gst_reserved[GST_PADDING]; */
+ guint8 _gst_reserved[(sizeof (gpointer) * GST_PADDING) - sizeof (gint)];
};
#define GST_RING_BUFFER_GET_COND(buf) (((GstRingBuffer *)buf)->cond)
@@ -264,6 +279,7 @@
gboolean flushing;
/* ATOMIC */
gint may_start;
+ gboolean active;
} ABI;
/* adding + 0 to mark ABI change to be undone later */
gpointer _gst_reserved[GST_PADDING + 0];
@@ -272,6 +288,7 @@
/**
* GstRingBufferClass:
+ * @parent_class: parent class
* @open_device: open the device, don't set any params or allocate anything
* @acquire: allocate the resources for the ringbuffer using the given spec
* @release: free resources of the ringbuffer
@@ -281,6 +298,10 @@
* @resume: resume processing of samples after pause
* @stop: stop processing of samples
* @delay: get number of samples queued in device
+ * @activate: activate the thread that starts pulling and monitoring the
+ * consumed segments in the device. Since 0.10.22
+ * @commit: write samples into the ringbuffer
+ * @clear_all: clear the entire ringbuffer Since 0.10.24
*
* The vmethods that subclasses can override to implement the ringbuffer.
*/
@@ -300,8 +321,17 @@
guint (*delay) (GstRingBuffer *buf);
+ /* ABI added */
+ gboolean (*activate) (GstRingBuffer *buf, gboolean active);
+
+ guint (*commit) (GstRingBuffer * buf, guint64 *sample,
+ guchar * data, gint in_samples,
+ gint out_samples, gint * accum);
+
+ void (*clear_all) (GstRingBuffer * buf);
+
/*< private >*/
- gpointer _gst_reserved[GST_PADDING];
+ gpointer _gst_reserved[GST_PADDING - 3];
};
#ifdef __SYMBIAN32__
IMPORT_C
@@ -333,6 +363,14 @@
#endif
void gst_ring_buffer_debug_spec_buff (GstRingBufferSpec *spec);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+gboolean gst_ring_buffer_convert (GstRingBuffer * buf, GstFormat src_fmt,
+ gint64 src_val, GstFormat dest_fmt,
+ gint64 * dest_val);
/* device state */
#ifdef __SYMBIAN32__
@@ -370,6 +408,18 @@
gboolean gst_ring_buffer_is_acquired (GstRingBuffer *buf);
+/* activating */
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gboolean gst_ring_buffer_activate (GstRingBuffer *buf, gboolean active);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gboolean gst_ring_buffer_is_active (GstRingBuffer *buf);
+
/* flushing */
#ifdef __SYMBIAN32__
IMPORT_C
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/make_filter
--- a/gst_plugins_base/gst-libs/gst/audio/make_filter Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-LANG=C
-LC_COLLATE=C
-export LANG
-export LC_COLLATE
-
-Template=$1;
-srcfile=$2;
-
-if test x"$1" = x ; then
- echo "$0 Objectname [srcfile]\n";
- echo " creates gstobjectname.{c,h} implementing GstObjectname,\n";
- echo " subclassing GstAudiofilter.\n";
- exit 1;
-fi
-
-if test x"$2" = x ; then
- srcfile="gstaudiofiltertemplate.c"
-fi
-
-id=`echo '$Id: make_filter,v 1.3 2004-04-19 22:51:56 ds Exp $' | sed \
- -e 's/\$I[d]: \([^$]*\)\$/\1/g'`
-echo $id
-
-TEMPLATE=`echo $Template | tr [:lower:] [:upper:]`
-template=`echo $Template | tr [:upper:] [:lower:]`
-
-echo TEMPLATE $TEMPLATE
-echo template $template
-
-# remember to break up the Id: in the line below
-sed \
- -e 's/gstaudiofiltertemplate\.c/SOURCEFILE/g' \
- -e "s/AudiofilterTemplate/$Template/g" \
- -e "s/audiofiltertemplate/$template/g" \
- -e "s/VIDEOFILTERTEMPLATE/$TEMPLATE/g" \
- -e 's/\$I[d]: \([^$]*\)\$/\1/g' \
- -e 's/SOURCEFILE/gstaudiofiltertemplate\.c/g' \
- -e "s%MAKEFILTERVERSION%$id%g" \
- $srcfile >gst$template.c.tmp && mv gst$template.c.tmp gst$template.c
-
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/multichannel-enumtypes.c
--- a/gst_plugins_base/gst-libs/gst/audio/multichannel-enumtypes.c Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-
-/* Generated data (by glib-mkenums) */
-
-#include "multichannel-enumtypes.h"
-
-#include "multichannel.h"
-
-/* enumerations from "multichannel.h" */
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-GType
-gst_audio_channel_position_get_type (void)
-{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { GST_AUDIO_CHANNEL_POSITION_INVALID, "GST_AUDIO_CHANNEL_POSITION_INVALID", "invalid" },
- { GST_AUDIO_CHANNEL_POSITION_FRONT_MONO, "GST_AUDIO_CHANNEL_POSITION_FRONT_MONO", "front-mono" },
- { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, "GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT", "front-left" },
- { GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT, "GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT", "front-right" },
- { GST_AUDIO_CHANNEL_POSITION_REAR_CENTER, "GST_AUDIO_CHANNEL_POSITION_REAR_CENTER", "rear-center" },
- { GST_AUDIO_CHANNEL_POSITION_REAR_LEFT, "GST_AUDIO_CHANNEL_POSITION_REAR_LEFT", "rear-left" },
- { GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT, "GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT", "rear-right" },
- { GST_AUDIO_CHANNEL_POSITION_LFE, "GST_AUDIO_CHANNEL_POSITION_LFE", "lfe" },
- { GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, "GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER", "front-center" },
- { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER, "GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER", "front-left-of-center" },
- { GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER, "GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER", "front-right-of-center" },
- { GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT, "GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT", "side-left" },
- { GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT, "GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT", "side-right" },
- { GST_AUDIO_CHANNEL_POSITION_NONE, "GST_AUDIO_CHANNEL_POSITION_NONE", "none" },
- { GST_AUDIO_CHANNEL_POSITION_NUM, "GST_AUDIO_CHANNEL_POSITION_NUM", "num" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("GstAudioChannelPosition", values);
- }
- return etype;
-}
-
-/* Generated data ends here */
-
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/multichannel-enumtypes.h
--- a/gst_plugins_base/gst-libs/gst/audio/multichannel-enumtypes.h Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-
-/* Generated data (by glib-mkenums) */
-
-#ifndef __GST_AUDIO_ENUM_TYPES_H__
-#define __GST_AUDIO_ENUM_TYPES_H__
-
-#include
-
-G_BEGIN_DECLS
-
-/* enumerations from "multichannel.h" */
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-GType gst_audio_channel_position_get_type (void);
-#define GST_TYPE_AUDIO_CHANNEL_POSITION (gst_audio_channel_position_get_type())
-G_END_DECLS
-
-#endif /* __GST_AUDIO_ENUM_TYPES_H__ */
-
-/* Generated data ends here */
-
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/multichannel.c
--- a/gst_plugins_base/gst-libs/gst/audio/multichannel.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/multichannel.c Wed Mar 24 18:04:17 2010 -0500
@@ -16,32 +16,53 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+/**
+ * SECTION:gstmultichannel
+ * @short_description: Support for multichannel audio elements
+ *
+ * This module contains some helper functions and a enum to work with
+ * multichannel audio.
+ */
#ifdef HAVE_CONFIG_H
-#include
+#include "config.h"
#endif
#include "multichannel.h"
#define GST_AUDIO_CHANNEL_POSITIONS_FIELD_NAME "channel-positions"
-/*
- * This function checks if basic assumptions apply:
- * - does each position occur at most once?
- * - do conflicting positions occur?
- * + front_mono vs. front_left/right
- * + front_center vs. front_left/right_of_center
- * + rear_center vs. rear_left/right
- * It also adds some hacks that 0.8.x needs for compatibility:
- * - if channels == 1, are we really mono?
- * - if channels == 2, are we really stereo?
+/**
+ * gst_audio_check_channel_positions:
+ * @pos: An array of #GstAudioChannelPosition.
+ * @channels: The number of elements in @pos.
+ *
+ * This functions checks if the given channel positions are valid. Channel
+ * positions are valid if:
+ *
+ * No channel positions appears twice or all positions are %GST_AUDIO_CHANNEL_POSITION_NONE.
+ *
+ * Either all or none of the channel positions are %GST_AUDIO_CHANNEL_POSITION_NONE.
+ *
+ * %GST_AUDIO_CHANNEL_POSITION_FRONT_MONO and %GST_AUDIO_CHANNEL_POSITION_LEFT or %GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT don't appear together in the given positions.
+ *
+ *
+ *
+ * Since: 0.10.20
+ *
+ * Returns: %TRUE if the given channel positions are valid
+ * and %FALSE otherwise.
*/
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
-static gboolean
+gboolean
gst_audio_check_channel_positions (const GstAudioChannelPosition * pos,
- gint channels)
+ guint channels)
{
gint i, n;
+
const struct
{
const GstAudioChannelPosition pos1[2];
@@ -51,27 +72,18 @@
{ {
GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT}, {
- GST_AUDIO_CHANNEL_POSITION_FRONT_MONO}},
- /* front center: 2 <-> 1 */
- { {
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER}, {
- GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER}},
- /* rear: 2 <-> 1 */
- { {
- GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
- GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT}, {
- GST_AUDIO_CHANNEL_POSITION_REAR_CENTER}}, { {
+ GST_AUDIO_CHANNEL_POSITION_FRONT_MONO}}, { {
GST_AUDIO_CHANNEL_POSITION_INVALID}}
};
- g_assert (pos != NULL && channels > 0);
+ g_return_val_if_fail (pos != NULL, FALSE);
+ g_return_val_if_fail (channels > 0, FALSE);
/* check for invalid channel positions */
for (n = 0; n < channels; n++) {
if (pos[n] <= GST_AUDIO_CHANNEL_POSITION_INVALID ||
pos[n] >= GST_AUDIO_CHANNEL_POSITION_NUM) {
- g_warning ("Channel position %d for channel %d is invalid", pos[n], n);
+ GST_WARNING ("Channel position %d for channel %d is invalid", pos[n], n);
return FALSE;
}
}
@@ -82,7 +94,7 @@
if (pos[0] == GST_AUDIO_CHANNEL_POSITION_NONE) {
for (n = 1; n < channels; ++n) {
if (pos[n] != GST_AUDIO_CHANNEL_POSITION_NONE) {
- g_warning ("Either all channel positions must be defined, or all "
+ GST_WARNING ("Either all channel positions must be defined, or all "
"be set to NONE, having only some defined is not allowed");
return FALSE;
}
@@ -103,13 +115,13 @@
/* NONE may not occur mixed with other channel positions */
if (i == GST_AUDIO_CHANNEL_POSITION_NONE && count > 0) {
- g_warning ("Either all channel positions must be defined, or all "
+ GST_WARNING ("Either all channel positions must be defined, or all "
"be set to NONE, having only some defined is not allowed");
return FALSE;
}
if (count > 1) {
- g_warning ("Channel position %d occurred %d times, not allowed",
+ GST_WARNING ("Channel position %d occurred %d times, not allowed",
i, count);
return FALSE;
}
@@ -127,21 +139,12 @@
}
if (found1 && found2) {
- g_warning ("Found conflicting channel positions %d/%d and %d",
+ GST_WARNING ("Found conflicting channel positions %d/%d and %d",
conf[i].pos1[0], conf[i].pos1[1], conf[i].pos2[0]);
return FALSE;
}
}
- /* Throw warning if we encounter an unusual 2-channel configuration,
- * at least until someone finds a reason why we should not */
- if (channels == 2 && (pos[0] != GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT ||
- pos[1] != GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT)) {
- g_warning ("channels=2 implies stereo, but channel positions are "
- "< %d, %d>", pos[0], pos[1]);
- return FALSE;
- }
-
return TRUE;
}
@@ -236,9 +239,13 @@
gst_audio_get_channel_positions (GstStructure * str)
{
GstAudioChannelPosition *pos;
+
gint channels, n;
+
const GValue *pos_val_arr, *pos_val_entry;
+
gboolean res;
+
GType t;
/* get number of channels, general type checkups */
@@ -316,6 +323,7 @@
GValue pos_val_arr = { 0 }, pos_val_entry = {
0};
gint channels, n;
+
gboolean res;
/* get number of channels, checkups */
@@ -383,11 +391,6 @@
g_return_if_fail (res);
g_return_if_fail (channels > 0);
- /* 0.8.x: channels=1 or channels=2 is mono/stereo, no positions needed
- * there (we discard them anyway) */
- if (channels == 1 || channels == 2)
- return;
-
/* create the array of lists */
g_value_init (&pos_val_arr, GST_TYPE_ARRAY);
g_value_init (&pos_val_entry, GST_TYPE_AUDIO_CHANNEL_POSITION);
@@ -417,6 +420,7 @@
const GstAudioChannelPosition * pos, gint num_positions)
{
GstCaps *caps = gst_caps_new_empty ();
+
const GValue *chan_val;
chan_val = gst_structure_get_value (str, "channels");
@@ -424,6 +428,7 @@
gst_audio_set_structure_channel_positions_list (str, pos, num_positions);
} else if (G_VALUE_TYPE (chan_val) == GST_TYPE_LIST) {
gint size;
+
const GValue *sub_val;
size = gst_value_list_get_size (chan_val);
@@ -526,9 +531,13 @@
gst_audio_fixate_channel_positions (GstStructure * str)
{
GstAudioChannelPosition *pos;
+
gint channels, n, num_unfixed = 0, i, c;
+
const GValue *pos_val_arr, *pos_val_entry, *pos_val;
+
gboolean res, is_stereo = TRUE;
+
GType t;
/*
@@ -543,19 +552,20 @@
const GstAudioChannelPosition pos2[1];
} conf[] = {
/* front: mono <-> stereo */
- { {
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
+ {
+ {
+ GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT}, {
- GST_AUDIO_CHANNEL_POSITION_FRONT_MONO}},
- /* front center: 2 <-> 1 */
- { {
+ GST_AUDIO_CHANNEL_POSITION_FRONT_MONO}}, { {
GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER}, {
- GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER}},
- /* rear: 2 <-> 1 */
- { {
+ GST_AUDIO_CHANNEL_POSITION_INVALID}}, { {
+ GST_AUDIO_CHANNEL_POSITION_INVALID, GST_AUDIO_CHANNEL_POSITION_INVALID}, {
+ GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER}}, { {
GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT}, {
+ GST_AUDIO_CHANNEL_POSITION_INVALID}}, { {
+ GST_AUDIO_CHANNEL_POSITION_INVALID, GST_AUDIO_CHANNEL_POSITION_INVALID}, {
GST_AUDIO_CHANNEL_POSITION_REAR_CENTER}}, { {
GST_AUDIO_CHANNEL_POSITION_INVALID, GST_AUDIO_CHANNEL_POSITION_INVALID}, {
GST_AUDIO_CHANNEL_POSITION_LFE}}, { {
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/multichannel.h
--- a/gst_plugins_base/gst-libs/gst/audio/multichannel.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/audio/multichannel.h Wed Mar 24 18:04:17 2010 -0500
@@ -21,7 +21,7 @@
#define __GST_AUDIO_MULTICHANNEL_H__
#include
-#include
+#include
G_BEGIN_DECLS
@@ -109,6 +109,12 @@
GstAudioChannelPosition *
gst_audio_fixate_channel_positions (GstStructure *str);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+gboolean gst_audio_check_channel_positions (const GstAudioChannelPosition * pos, guint channels);
G_END_DECLS
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/audio/testchannels.c
--- a/gst_plugins_base/gst-libs/gst/audio/testchannels.c Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/* GStreamer Multichannel Test
- * (c) 2004 Ronald Bultje
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include
-#endif
-
-#include
-
-#include
-#include
-
-gint
-main (gint argc, gchar * argv[])
-{
- gchar *str;
- GstCaps *caps;
- GstAudioChannelPosition pos[2] = { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT
- };
-
- /* register multichannel type */
- gst_init (&argc, &argv);
- gst_audio_channel_position_get_type ();
-
- /* test some caps-string conversions */
- caps = gst_caps_new_simple ("audio/x-raw-int",
- "channels", G_TYPE_INT, 2, NULL);
- str = gst_caps_to_string (caps);
- g_print ("Test caps #1: %s\n", str);
- g_free (str);
- gst_audio_set_channel_positions (gst_caps_get_structure (caps, 0), pos);
- str = gst_caps_to_string (caps);
- g_print ("Test caps #2: %s\n", str);
- g_free (str);
- gst_caps_unref (caps);
-
- return 0;
-}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/cdda/base64.c
--- a/gst_plugins_base/gst-libs/gst/cdda/base64.c Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/* --------------------------------------------------------------------------
-
- MusicBrainz -- The Internet music metadatabase
-
- Copyright (C) 2000 Robert Kaye
-
- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- $Id: base64.c,v 1.1 2005-12-28 18:06:50 tpm Exp $
-
-----------------------------------------------------------------------------*/
-/*
- * Program: RFC-822 routines (originally from SMTP)
- *
- * Author: Mark Crispin
- * Networks and Distributed Computing
- * Computing & Communications
- * University of Washington
- * Administration Building, AG-44
- * Seattle, WA 98195
- * Internet: MRC@CAC.Washington.EDU
- *
- * Date: 27 July 1988
- * Last Edited: 10 September 1998
- *
- * Sponsorship: The original version of this work was developed in the
- * Symbolic Systems Resources Group of the Knowledge Systems
- * Laboratory at Stanford University in 1987-88, and was funded
- * by the Biomedical Research Technology Program of the National
- * Institutes of Health under grant number RR-00785.
- *
- * Original version Copyright 1988 by The Leland Stanford Junior University
- * Copyright 1998 by the University of Washington
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notices appear in all copies and that both the
- * above copyright notices and this permission notice appear in supporting
- * documentation, and that the name of the University of Washington or The
- * Leland Stanford Junior University not be used in advertising or publicity
- * pertaining to distribution of the software without specific, written prior
- * permission. This software is made available "as is", and
- * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY
- * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE,
- * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
- * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#include
-#include
-#include
-#include
-
-#include "base64.h"
-
-/* NOTE: This is not true RFC822 anymore. The use of the characters
- '/', '+', and '=' is no bueno when the ID will be used as part of a URL.
- '_', '.', and '-' have been used instead
-*/
-
-/* Convert binary contents to BASE64
- * Accepts: source
- * length of source
- * pointer to return destination length
- * Returns: destination as BASE64
- */
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-unsigned char *
-rfc822_binary (void *src, unsigned long srcl, unsigned long *len)
-{
- unsigned char *ret, *d;
- unsigned char *s = (unsigned char *) src;
- char *v = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._";
- unsigned long i = ((srcl + 2) / 3) * 4;
-
- *len = i += 2 * ((i / 60) + 1);
- d = ret = (unsigned char *) malloc ((size_t)++ i);
- for (i = 0; srcl; s += 3) { /* process tuplets */
- *d++ = v[s[0] >> 2]; /* byte 1: high 6 bits (1) */
- /* byte 2: low 2 bits (1), high 4 bits (2) */
- *d++ = v[((s[0] << 4) + (--srcl ? (s[1] >> 4) : 0)) & 0x3f];
- /* byte 3: low 4 bits (2), high 2 bits (3) */
- *d++ = srcl ? v[((s[1] << 2) + (--srcl ? (s[2] >> 6) : 0)) & 0x3f] : '-';
- /* byte 4: low 6 bits (3) */
- *d++ = srcl ? v[s[2] & 0x3f] : '-';
- if (srcl)
- srcl--; /* count third character if processed */
- if ((++i) == 15) { /* output 60 characters? */
- i = 0; /* restart line break count, insert CRLF */
- *d++ = '\015';
- *d++ = '\012';
- }
- }
- *d = '\0'; /* tie off string */
-
- return ret; /* return the resulting string */
-}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/cdda/base64.h
--- a/gst_plugins_base/gst-libs/gst/cdda/base64.h Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/* --------------------------------------------------------------------------
-
- MusicBrainz -- The Internet music metadatabase
-
- Copyright (C) 2000 Robert Kaye
-
- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- $Id: base64.h,v 1.2 2007-12-13 10:10:35 tpm Exp $
-
-----------------------------------------------------------------------------*/
-/*
- * Program: RFC-822 routines (originally from SMTP)
- *
- * Author: Mark Crispin
- * Networks and Distributed Computing
- * Computing & Communications
- * University of Washington
- * Administration Building, AG-44
- * Seattle, WA 98195
- * Internet: MRC@CAC.Washington.EDU
- *
- * Date: 27 July 1988
- * Last Edited: 10 September 1998
- *
- * Sponsorship: The original version of this work was developed in the
- * Symbolic Systems Resources Group of the Knowledge Systems
- * Laboratory at Stanford University in 1987-88, and was funded
- * by the Biomedical Research Technology Program of the National
- * Institutes of Health under grant number RR-00785.
- *
- * Original version Copyright 1988 by The Leland Stanford Junior University
- * Copyright 1998 by the University of Washington
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notices appear in all copies and that both the
- * above copyright notices and this permission notice appear in supporting
- * documentation, and that the name of the University of Washington or The
- * Leland Stanford Junior University not be used in advertising or publicity
- * pertaining to distribution of the software without specific, written prior
- * permission. This software is made available "as is", and
- * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY
- * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE,
- * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
- * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-#ifndef __GST_CDDA_BASE64_H__
-#define __GST_CDDA_BASE64_H__
-
-#define rfc822_binary __gst_cdda_rfc822_binary
-
-unsigned char *rfc822_binary (void *src,unsigned long srcl,unsigned long *len);
-
-#endif /* __GST_CDDA_BASE64_H__ */
-
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/cdda/gstcddabasesrc.c
--- a/gst_plugins_base/gst-libs/gst/cdda/gstcddabasesrc.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/cdda/gstcddabasesrc.c Wed Mar 24 18:04:17 2010 -0500
@@ -81,7 +81,6 @@
*
*/
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -92,10 +91,6 @@
#include "gstcddabasesrc.h"
#include "gst/gst-i18n-plugin.h"
-#ifdef __SYMBIAN32__
-#include
-#endif
-
GST_DEBUG_CATEGORY_STATIC (gst_cdda_base_src_debug);
#define GST_CAT_DEFAULT gst_cdda_base_src_debug
@@ -109,8 +104,6 @@
#define TIME_INTERVAL_FROM_SECTORS(sectors) ((SAMPLES_PER_SECTOR * sectors * GST_SECOND) / 44100)
#define SECTORS_FROM_TIME_INTERVAL(dtime) (dtime * 44100 / (SAMPLES_PER_SECTOR * GST_SECOND))
-#define GST_TYPE_CDDA_BASE_SRC_MODE (gst_cdda_base_src_mode_get_type ())
-
enum
{
ARG_0,
@@ -164,8 +157,12 @@
/* our two formats */
static GstFormat track_format;
static GstFormat sector_format;
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
-static GType
+
+GType
gst_cdda_base_src_mode_get_type (void)
{
static GType mode_type; /* 0 */
@@ -226,14 +223,15 @@
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DEVICE,
g_param_spec_string ("device", "Device", "CD device location",
- NULL, G_PARAM_READWRITE));
+ NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MODE,
g_param_spec_enum ("mode", "Mode", "Mode", GST_TYPE_CDDA_BASE_SRC_MODE,
- GST_CDDA_BASE_SRC_MODE_NORMAL, G_PARAM_READWRITE));
+ GST_CDDA_BASE_SRC_MODE_NORMAL,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TRACK,
g_param_spec_uint ("track", "Track", "Track", 1, 99, 1,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#if 0
/* Do we really need this toc adjustment stuff as properties? does the user
@@ -244,12 +242,13 @@
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TOC_OFFSET,
g_param_spec_int ("toc-offset", "Table of contents offset",
"Add sectors to the values reported", G_MININT, G_MAXINT, 0,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TOC_BIAS,
g_param_spec_boolean ("toc-bias", "Table of contents bias",
"Assume that the beginning offset of track 1 as reported in the TOC "
"will be addressed as LBA 0. Necessary for some Toshiba drives to "
- "get track boundaries", FALSE, G_PARAM_READWRITE));
+ "get track boundaries", FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#endif
element_class->set_index = GST_DEBUG_FUNCPTR (gst_cdda_base_src_set_index);
@@ -880,7 +879,6 @@
}
default:{
GST_LOG_OBJECT (src, "let base class handle event");
- event = gst_event_ref (event);
ret = GST_BASE_SRC_CLASS (parent_class)->event (basesrc, event);
break;
}
@@ -1034,7 +1032,7 @@
if (src->num_tracks > 0) {
guint end_of_previous_track = src->tracks[src->num_tracks - 1].end;
- if (track->start < end_of_previous_track) {
+ if (track->start <= end_of_previous_track) {
GST_WARNING ("track %2u overlaps with previous tracks", track->num);
return FALSE;
}
@@ -1091,36 +1089,35 @@
return ret;
}
-#include "base64.h"
-#include "sha1.h"
-
static void
gst_cddabasesrc_calculate_musicbrainz_discid (GstCddaBaseSrc * src)
{
GString *s;
- SHA_INFO sha;
- guchar digest[20], *ptr;
+ GChecksum *sha;
+ guchar digest[20];
+ gchar *ptr;
gchar tmp[9];
gulong i;
guint leadout_sector;
+ gsize digest_len;
s = g_string_new (NULL);
leadout_sector = src->tracks[src->num_tracks - 1].end + 1 + CD_MSF_OFFSET;
/* generate SHA digest */
- sha_init (&sha);
+ sha = g_checksum_new (G_CHECKSUM_SHA1);
g_snprintf (tmp, sizeof (tmp), "%02X", src->tracks[0].num);
g_string_append_printf (s, "%02X", src->tracks[0].num);
- sha_update (&sha, (SHA_BYTE *) tmp, 2);
+ g_checksum_update (sha, (guchar *) tmp, 2);
g_snprintf (tmp, sizeof (tmp), "%02X", src->tracks[src->num_tracks - 1].num);
g_string_append_printf (s, " %02X", src->tracks[src->num_tracks - 1].num);
- sha_update (&sha, (SHA_BYTE *) tmp, 2);
+ g_checksum_update (sha, (guchar *) tmp, 2);
g_snprintf (tmp, sizeof (tmp), "%08X", leadout_sector);
g_string_append_printf (s, " %08X", leadout_sector);
- sha_update (&sha, (SHA_BYTE *) tmp, 8);
+ g_checksum_update (sha, (guchar *) tmp, 8);
for (i = 0; i < 99; i++) {
if (i < src->num_tracks) {
@@ -1128,21 +1125,36 @@
g_snprintf (tmp, sizeof (tmp), "%08X", frame_offset);
g_string_append_printf (s, " %08X", frame_offset);
- sha_update (&sha, (SHA_BYTE *) tmp, 8);
+ g_checksum_update (sha, (guchar *) tmp, 8);
} else {
- sha_update (&sha, (SHA_BYTE *) "00000000", 8);
+ g_checksum_update (sha, (guchar *) "00000000", 8);
}
}
- sha_final (digest, &sha);
+ digest_len = 20;
+ g_checksum_get_digest (sha, (guint8 *) & digest, &digest_len);
/* re-encode to base64 */
- ptr = rfc822_binary (digest, 20, &i);
+ ptr = g_base64_encode (digest, digest_len);
+ g_checksum_free (sha);
+ i = strlen (ptr);
g_assert (i < sizeof (src->mb_discid) + 1);
memcpy (src->mb_discid, ptr, i);
src->mb_discid[i] = '\0';
free (ptr);
+ /* Replace '/', '+' and '=' by '_', '.' and '-' as specified on
+ * http://musicbrainz.org/doc/DiscIDCalculation
+ */
+ for (ptr = src->mb_discid; *ptr != '\0'; ptr++) {
+ if (*ptr == '/')
+ *ptr = '_';
+ else if (*ptr == '+')
+ *ptr = '.';
+ else if (*ptr == '=')
+ *ptr = '-';
+ }
+
GST_DEBUG_OBJECT (src, "musicbrainz-discid = %s", src->mb_discid);
GST_DEBUG_OBJECT (src, "musicbrainz-discid-full = %s", s->str);
@@ -1268,7 +1280,7 @@
GST_FORMAT_TIME, &duration);
gst_tag_list_add (src->tracks[i].tags,
- GST_TAG_MERGE_REPLACE_ALL,
+ GST_TAG_MERGE_REPLACE,
GST_TAG_TRACK_NUMBER, i + 1,
GST_TAG_TRACK_COUNT, src->num_tracks, GST_TAG_DURATION, duration, NULL);
}
@@ -1282,7 +1294,7 @@
* gst_tag_list_get_value_index() rather than use tag names incl.
* the track number ?? *////////////////////////////////////////
- gst_tag_list_add (src->tags, GST_TAG_MERGE_REPLACE_ALL,
+ gst_tag_list_add (src->tags, GST_TAG_MERGE_REPLACE,
GST_TAG_TRACK_COUNT, src->num_tracks, NULL);
#if 0
for (i = 0; i < src->num_tracks; ++i) {
@@ -1511,10 +1523,10 @@
switch (src->mode) {
case GST_CDDA_BASE_SRC_MODE_NORMAL:
- eos = (src->cur_sector >= src->tracks[src->cur_track].end);
+ eos = (src->cur_sector > src->tracks[src->cur_track].end);
break;
case GST_CDDA_BASE_SRC_MODE_CONTINUOUS:
- eos = (src->cur_sector >= src->tracks[src->num_tracks - 1].end);
+ eos = (src->cur_sector > src->tracks[src->num_tracks - 1].end);
src->cur_track = gst_cdda_base_src_get_track_from_sector (src,
src->cur_sector);
break;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/cdda/gstcddabasesrc.h
--- a/gst_plugins_base/gst-libs/gst/cdda/gstcddabasesrc.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/cdda/gstcddabasesrc.h Wed Mar 24 18:04:17 2010 -0500
@@ -54,6 +54,8 @@
GST_CDDA_BASE_SRC_MODE_CONTINUOUS /* stream = whole disc */
} GstCddaBaseSrcMode;
+#define GST_TYPE_CDDA_BASE_SRC_MODE (gst_cdda_base_src_mode_get_type ())
+
/**
* GstCddaBaseSrcTrack:
* @is_audio: Whether this is an audio track
@@ -142,6 +144,11 @@
IMPORT_C
#endif
+GType gst_cdda_base_src_mode_get_type (void);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
gboolean gst_cdda_base_src_add_track (GstCddaBaseSrc * src,
GstCddaBaseSrcTrack * track);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/cdda/sha1.c
--- a/gst_plugins_base/gst-libs/gst/cdda/sha1.c Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,450 +0,0 @@
-/* (PD) 2001 The Bitzi Corporation
- * Please see file COPYING or http://bitzi.com/publicdomain
- * for more info.
- *
- * NIST Secure Hash Algorithm
- * heavily modified by Uwe Hollerbach
- * from Peter C. Gutmann's implementation as found in
- * Applied Cryptography by Bruce Schneier
- * Further modifications to include the "UNRAVEL" stuff, below
- *
- * This code is in the public domain
- *
- * $Id: sha1.c,v 1.2 2008-02-27 10:42:08 slomo Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include
-#define SHA_BYTE_ORDER G_BYTE_ORDER
-
-#include
-#include "sha1.h"
-
-/* UNRAVEL should be fastest & biggest */
-/* UNROLL_LOOPS should be just as big, but slightly slower */
-/* both undefined should be smallest and slowest */
-
-#define UNRAVEL
-/* #define UNROLL_LOOPS */
-
-/* SHA f()-functions */
-
-#define f1(x,y,z) ((x & y) | (~x & z))
-#define f2(x,y,z) (x ^ y ^ z)
-#define f3(x,y,z) ((x & y) | (x & z) | (y & z))
-#define f4(x,y,z) (x ^ y ^ z)
-
-/* SHA constants */
-
-#define CONST1 0x5a827999L
-#define CONST2 0x6ed9eba1L
-#define CONST3 0x8f1bbcdcL
-#define CONST4 0xca62c1d6L
-
-/* truncate to 32 bits -- should be a null op on 32-bit machines */
-
-#define T32(x) ((x) & 0xffffffffL)
-
-/* 32-bit rotate */
-
-#define R32(x,n) T32(((x << n) | (x >> (32 - n))))
-
-/* the generic case, for when the overall rotation is not unraveled */
-
-#define FG(n) \
- T = T32(R32(A,5) + f##n(B,C,D) + E + *WP++ + CONST##n); \
- E = D; D = C; C = R32(B,30); B = A; A = T
-
-/* specific cases, for when the overall rotation is unraveled */
-
-#define FA(n) \
- T = T32(R32(A,5) + f##n(B,C,D) + E + *WP++ + CONST##n); B = R32(B,30)
-
-#define FB(n) \
- E = T32(R32(T,5) + f##n(A,B,C) + D + *WP++ + CONST##n); A = R32(A,30)
-
-#define FC(n) \
- D = T32(R32(E,5) + f##n(T,A,B) + C + *WP++ + CONST##n); T = R32(T,30)
-
-#define FD(n) \
- C = T32(R32(D,5) + f##n(E,T,A) + B + *WP++ + CONST##n); E = R32(E,30)
-
-#define FE(n) \
- B = T32(R32(C,5) + f##n(D,E,T) + A + *WP++ + CONST##n); D = R32(D,30)
-
-#define FT(n) \
- A = T32(R32(B,5) + f##n(C,D,E) + T + *WP++ + CONST##n); C = R32(C,30)
-
-/* do SHA transformation */
-
-static void
-sha_transform (SHA_INFO * sha_info)
-{
- int i;
- SHA_BYTE *dp;
- SHA_LONG T, A, B, C, D, E, W[80], *WP;
-
- dp = sha_info->data;
-
-/*
-the following makes sure that at least one code block below is
-traversed or an error is reported, without the necessity for nested
-preprocessor if/else/endif blocks, which are a great pain in the
-nether regions of the anatomy...
-*/
-#undef SWAP_DONE
-
-#if (SHA_BYTE_ORDER == 1234)
-#define SWAP_DONE
- for (i = 0; i < 16; ++i) {
- memcpy (&T, dp, sizeof (SHA_LONG));
- dp += 4;
- W[i] = ((T << 24) & 0xff000000) | ((T << 8) & 0x00ff0000) |
- ((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff);
- }
-#endif /* SHA_BYTE_ORDER == 1234 */
-
-#if (SHA_BYTE_ORDER == 4321)
-#define SWAP_DONE
- for (i = 0; i < 16; ++i) {
- memcpy (&T, dp, sizeof (SHA_LONG));
- dp += 4;
- W[i] = T32 (T);
- }
-#endif /* SHA_BYTE_ORDER == 4321 */
-
-#if (SHA_BYTE_ORDER == 12345678)
-#define SWAP_DONE
- for (i = 0; i < 16; i += 2) {
- memcpy (&T, dp, sizeof (SHA_LONG));
- dp += 8;
- W[i] = ((T << 24) & 0xff000000) | ((T << 8) & 0x00ff0000) |
- ((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff);
- T >>= 32;
- W[i + 1] = ((T << 24) & 0xff000000) | ((T << 8) & 0x00ff0000) |
- ((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff);
- }
-#endif /* SHA_BYTE_ORDER == 12345678 */
-
-#if (SHA_BYTE_ORDER == 87654321)
-#define SWAP_DONE
- for (i = 0; i < 16; i += 2) {
- memcpy (&T, dp, sizeof (SHA_LONG));
- dp += 8;
- W[i] = T32 (T >> 32);
- W[i + 1] = T32 (T);
- }
-#endif /* SHA_BYTE_ORDER == 87654321 */
-
-#ifndef SWAP_DONE
-#error Unknown byte order -- you need to add code here
-#endif /* SWAP_DONE */
-
- for (i = 16; i < 80; ++i) {
- W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
-#if (SHA_VERSION == 1)
- W[i] = R32 (W[i], 1);
-#endif /* SHA_VERSION */
- }
- A = sha_info->digest[0];
- B = sha_info->digest[1];
- C = sha_info->digest[2];
- D = sha_info->digest[3];
- E = sha_info->digest[4];
- WP = W;
-#ifdef UNRAVEL
- FA (1);
- FB (1);
- FC (1);
- FD (1);
- FE (1);
- FT (1);
- FA (1);
- FB (1);
- FC (1);
- FD (1);
- FE (1);
- FT (1);
- FA (1);
- FB (1);
- FC (1);
- FD (1);
- FE (1);
- FT (1);
- FA (1);
- FB (1);
- FC (2);
- FD (2);
- FE (2);
- FT (2);
- FA (2);
- FB (2);
- FC (2);
- FD (2);
- FE (2);
- FT (2);
- FA (2);
- FB (2);
- FC (2);
- FD (2);
- FE (2);
- FT (2);
- FA (2);
- FB (2);
- FC (2);
- FD (2);
- FE (3);
- FT (3);
- FA (3);
- FB (3);
- FC (3);
- FD (3);
- FE (3);
- FT (3);
- FA (3);
- FB (3);
- FC (3);
- FD (3);
- FE (3);
- FT (3);
- FA (3);
- FB (3);
- FC (3);
- FD (3);
- FE (3);
- FT (3);
- FA (4);
- FB (4);
- FC (4);
- FD (4);
- FE (4);
- FT (4);
- FA (4);
- FB (4);
- FC (4);
- FD (4);
- FE (4);
- FT (4);
- FA (4);
- FB (4);
- FC (4);
- FD (4);
- FE (4);
- FT (4);
- FA (4);
- FB (4);
- sha_info->digest[0] = T32 (sha_info->digest[0] + E);
- sha_info->digest[1] = T32 (sha_info->digest[1] + T);
- sha_info->digest[2] = T32 (sha_info->digest[2] + A);
- sha_info->digest[3] = T32 (sha_info->digest[3] + B);
- sha_info->digest[4] = T32 (sha_info->digest[4] + C);
-#else /* !UNRAVEL */
-#ifdef UNROLL_LOOPS
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (1);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (2);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (3);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
- FG (4);
-#else /* !UNROLL_LOOPS */
- for (i = 0; i < 20; ++i) {
- FG (1);
- }
- for (i = 20; i < 40; ++i) {
- FG (2);
- }
- for (i = 40; i < 60; ++i) {
- FG (3);
- }
- for (i = 60; i < 80; ++i) {
- FG (4);
- }
-#endif /* !UNROLL_LOOPS */
- sha_info->digest[0] = T32 (sha_info->digest[0] + A);
- sha_info->digest[1] = T32 (sha_info->digest[1] + B);
- sha_info->digest[2] = T32 (sha_info->digest[2] + C);
- sha_info->digest[3] = T32 (sha_info->digest[3] + D);
- sha_info->digest[4] = T32 (sha_info->digest[4] + E);
-#endif /* !UNRAVEL */
-}
-
-/* initialize the SHA digest */
-
-void
-sha_init (SHA_INFO * sha_info)
-{
- sha_info->digest[0] = 0x67452301L;
- sha_info->digest[1] = 0xefcdab89L;
- sha_info->digest[2] = 0x98badcfeL;
- sha_info->digest[3] = 0x10325476L;
- sha_info->digest[4] = 0xc3d2e1f0L;
- sha_info->count_lo = 0L;
- sha_info->count_hi = 0L;
- sha_info->local = 0;
-}
-
-/* update the SHA digest */
-
-void
-sha_update (SHA_INFO * sha_info, SHA_BYTE * buffer, int count)
-{
- int i;
- SHA_LONG clo;
-
- clo = T32 (sha_info->count_lo + ((SHA_LONG) count << 3));
- if (clo < sha_info->count_lo) {
- ++sha_info->count_hi;
- }
- sha_info->count_lo = clo;
- sha_info->count_hi += (SHA_LONG) count >> 29;
- if (sha_info->local) {
- i = SHA_BLOCKSIZE - sha_info->local;
- if (i > count) {
- i = count;
- }
- memcpy (((SHA_BYTE *) sha_info->data) + sha_info->local, buffer, i);
- count -= i;
- buffer += i;
- sha_info->local += i;
- if (sha_info->local == SHA_BLOCKSIZE) {
- sha_transform (sha_info);
- } else {
- return;
- }
- }
- while (count >= SHA_BLOCKSIZE) {
- memcpy (sha_info->data, buffer, SHA_BLOCKSIZE);
- buffer += SHA_BLOCKSIZE;
- count -= SHA_BLOCKSIZE;
- sha_transform (sha_info);
- }
- memcpy (sha_info->data, buffer, count);
- sha_info->local = count;
-}
-
-/* finish computing the SHA digest */
-
-void
-sha_final (unsigned char digest[20], SHA_INFO * sha_info)
-{
- int count;
- SHA_LONG lo_bit_count, hi_bit_count;
-
- lo_bit_count = sha_info->count_lo;
- hi_bit_count = sha_info->count_hi;
- count = (int) ((lo_bit_count >> 3) & 0x3f);
- ((SHA_BYTE *) sha_info->data)[count++] = 0x80;
- if (count > SHA_BLOCKSIZE - 8) {
- memset (((SHA_BYTE *) sha_info->data) + count, 0, SHA_BLOCKSIZE - count);
- sha_transform (sha_info);
- memset ((SHA_BYTE *) sha_info->data, 0, SHA_BLOCKSIZE - 8);
- } else {
- memset (((SHA_BYTE *) sha_info->data) + count, 0,
- SHA_BLOCKSIZE - 8 - count);
- }
- sha_info->data[56] = (unsigned char) ((hi_bit_count >> 24) & 0xff);
- sha_info->data[57] = (unsigned char) ((hi_bit_count >> 16) & 0xff);
- sha_info->data[58] = (unsigned char) ((hi_bit_count >> 8) & 0xff);
- sha_info->data[59] = (unsigned char) ((hi_bit_count >> 0) & 0xff);
- sha_info->data[60] = (unsigned char) ((lo_bit_count >> 24) & 0xff);
- sha_info->data[61] = (unsigned char) ((lo_bit_count >> 16) & 0xff);
- sha_info->data[62] = (unsigned char) ((lo_bit_count >> 8) & 0xff);
- sha_info->data[63] = (unsigned char) ((lo_bit_count >> 0) & 0xff);
- sha_transform (sha_info);
- digest[0] = (unsigned char) ((sha_info->digest[0] >> 24) & 0xff);
- digest[1] = (unsigned char) ((sha_info->digest[0] >> 16) & 0xff);
- digest[2] = (unsigned char) ((sha_info->digest[0] >> 8) & 0xff);
- digest[3] = (unsigned char) ((sha_info->digest[0]) & 0xff);
- digest[4] = (unsigned char) ((sha_info->digest[1] >> 24) & 0xff);
- digest[5] = (unsigned char) ((sha_info->digest[1] >> 16) & 0xff);
- digest[6] = (unsigned char) ((sha_info->digest[1] >> 8) & 0xff);
- digest[7] = (unsigned char) ((sha_info->digest[1]) & 0xff);
- digest[8] = (unsigned char) ((sha_info->digest[2] >> 24) & 0xff);
- digest[9] = (unsigned char) ((sha_info->digest[2] >> 16) & 0xff);
- digest[10] = (unsigned char) ((sha_info->digest[2] >> 8) & 0xff);
- digest[11] = (unsigned char) ((sha_info->digest[2]) & 0xff);
- digest[12] = (unsigned char) ((sha_info->digest[3] >> 24) & 0xff);
- digest[13] = (unsigned char) ((sha_info->digest[3] >> 16) & 0xff);
- digest[14] = (unsigned char) ((sha_info->digest[3] >> 8) & 0xff);
- digest[15] = (unsigned char) ((sha_info->digest[3]) & 0xff);
- digest[16] = (unsigned char) ((sha_info->digest[4] >> 24) & 0xff);
- digest[17] = (unsigned char) ((sha_info->digest[4] >> 16) & 0xff);
- digest[18] = (unsigned char) ((sha_info->digest[4] >> 8) & 0xff);
- digest[19] = (unsigned char) ((sha_info->digest[4]) & 0xff);
-}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/cdda/sha1.h
--- a/gst_plugins_base/gst-libs/gst/cdda/sha1.h Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/* NIST Secure Hash Algorithm */
-/* heavily modified by Uwe Hollerbach */
-/* from Peter C. Gutmann's implementation as found in */
-/* Applied Cryptography by Bruce Schneier */
-/* This code is in the public domain */
-/* $Id: sha1.h,v 1.2 2007-12-13 10:10:35 tpm Exp $ */
-
-#ifndef __GST_CDDA_SHA_H__
-#define __GST_CDDA_SHA_H__
-
-#include
-#include
-
-/* Useful defines & typedefs */
-typedef unsigned char SHA_BYTE; /* 8-bit quantity */
-typedef unsigned long SHA_LONG; /* 32-or-more-bit quantity */
-
-#define SHA_BLOCKSIZE 64
-#define SHA_DIGESTSIZE 20
-
-typedef struct {
- SHA_LONG digest[5]; /* message digest */
- SHA_LONG count_lo, count_hi; /* 64-bit bit count */
- SHA_BYTE data[SHA_BLOCKSIZE]; /* SHA data buffer */
- int local; /* unprocessed amount in data */
-} SHA_INFO;
-
-#define sha_init __gst_cdda_sha_init
-#define sha_update __gst_cdda_sha_update
-#define sha_final __gst_cdda_sha_final
-
-void sha_init(SHA_INFO *);
-void sha_update(SHA_INFO *, SHA_BYTE *, int);
-void sha_final(unsigned char [20], SHA_INFO *);
-
-#define SHA_VERSION 1
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-
-
-#ifdef WORDS_BIGENDIAN
-# if SIZEOF_LONG == 4
-# define SHA_BYTE_ORDER 4321
-# elif SIZEOF_LONG == 8
-# define SHA_BYTE_ORDER 87654321
-# endif
-#else
-# if SIZEOF_LONG == 4
-# define SHA_BYTE_ORDER 1234
-# elif SIZEOF_LONG == 8
-# define SHA_BYTE_ORDER 12345678
-# endif
-#endif
-
-#else
-
-#define SHA_BYTE_ORDER 1234
-
-#endif
-
-#endif /* __GST_CDDA_SHA_H__ */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_f32.h
--- a/gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_f32.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_f32.h Wed Mar 24 18:04:17 2010 -0500
@@ -19,6 +19,20 @@
#include "kiss_fft_f32.h"
#include
+/* The 2*sizeof(size_t) alignment here is borrowed from
+ * GNU libc, so it should be good most everywhere.
+ * It is more conservative than is needed on some 64-bit
+ * platforms, but ia64 does require a 16-byte alignment.
+ * The SIMD extensions for x86 and ppc32 would want a
+ * larger alignment than this, but we don't need to
+ * do better than malloc.
+ *
+ * Borrowed from GLib's gobject/gtype.c
+ */
+#define STRUCT_ALIGNMENT (2 * sizeof (size_t))
+#define ALIGN_STRUCT(offset) \
+ ((offset + (STRUCT_ALIGNMENT - 1)) & -STRUCT_ALIGNMENT)
+
#define MAXFACTORS 32
/* e.g. an fft of length 128 has 4 factors
as far as kissfft is concerned
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_f64.h
--- a/gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_f64.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_f64.h Wed Mar 24 18:04:17 2010 -0500
@@ -19,6 +19,20 @@
#include "kiss_fft_f64.h"
#include
+/* The 2*sizeof(size_t) alignment here is borrowed from
+ * GNU libc, so it should be good most everywhere.
+ * It is more conservative than is needed on some 64-bit
+ * platforms, but ia64 does require a 16-byte alignment.
+ * The SIMD extensions for x86 and ppc32 would want a
+ * larger alignment than this, but we don't need to
+ * do better than malloc.
+ *
+ * Borrowed from GLib's gobject/gtype.c
+ */
+#define STRUCT_ALIGNMENT (2 * sizeof (size_t))
+#define ALIGN_STRUCT(offset) \
+ ((offset + (STRUCT_ALIGNMENT - 1)) & -STRUCT_ALIGNMENT)
+
#define MAXFACTORS 32
/* e.g. an fft of length 128 has 4 factors
as far as kissfft is concerned
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_s16.h
--- a/gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_s16.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_s16.h Wed Mar 24 18:04:17 2010 -0500
@@ -19,6 +19,20 @@
#include "kiss_fft_s16.h"
#include
+/* The 2*sizeof(size_t) alignment here is borrowed from
+ * GNU libc, so it should be good most everywhere.
+ * It is more conservative than is needed on some 64-bit
+ * platforms, but ia64 does require a 16-byte alignment.
+ * The SIMD extensions for x86 and ppc32 would want a
+ * larger alignment than this, but we don't need to
+ * do better than malloc.
+ *
+ * Borrowed from GLib's gobject/gtype.c
+ */
+#define STRUCT_ALIGNMENT (2 * sizeof (size_t))
+#define ALIGN_STRUCT(offset) \
+ ((offset + (STRUCT_ALIGNMENT - 1)) & -STRUCT_ALIGNMENT)
+
#define MAXFACTORS 32
/* e.g. an fft of length 128 has 4 factors
as far as kissfft is concerned
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_s32.h
--- a/gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_s32.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/_kiss_fft_guts_s32.h Wed Mar 24 18:04:17 2010 -0500
@@ -19,6 +19,20 @@
#include "kiss_fft_s32.h"
#include
+/* The 2*sizeof(size_t) alignment here is borrowed from
+ * GNU libc, so it should be good most everywhere.
+ * It is more conservative than is needed on some 64-bit
+ * platforms, but ia64 does require a 16-byte alignment.
+ * The SIMD extensions for x86 and ppc32 would want a
+ * larger alignment than this, but we don't need to
+ * do better than malloc.
+ *
+ * Borrowed from GLib's gobject/gtype.c
+ */
+#define STRUCT_ALIGNMENT (2 * sizeof (size_t))
+#define ALIGN_STRUCT(offset) \
+ ((offset + (STRUCT_ALIGNMENT - 1)) & -STRUCT_ALIGNMENT)
+
#define MAXFACTORS 32
/* e.g. an fft of length 128 has 4 factors
as far as kissfft is concerned
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/gstfft.c
--- a/gst_plugins_base/gst-libs/gst/fft/gstfft.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/gstfft.c Wed Mar 24 18:04:17 2010 -0500
@@ -23,7 +23,6 @@
*
* This library includes general definitions and functions, useful for
* all typed FFT classes.
- *
*/
#include
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/gstfftf32.c
--- a/gst_plugins_base/gst-libs/gst/fft/gstfftf32.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/gstfftf32.c Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
#include
#include
+#include "_kiss_fft_guts_f32.h"
#include "kiss_fftr_f32.h"
#include "gstfft.h"
#include "gstfftf32.h"
@@ -78,13 +79,18 @@
gst_fft_f32_new (gint len, gboolean inverse)
{
GstFFTF32 *self;
+ gsize subsize = 0, memneeded;
g_return_val_if_fail (len > 0, NULL);
g_return_val_if_fail (len % 2 == 0, NULL);
- self = g_new (GstFFTF32, 1);
+ kiss_fftr_f32_alloc (len, (inverse) ? 1 : 0, NULL, &subsize);
+ memneeded = ALIGN_STRUCT (sizeof (GstFFTF32)) + subsize;
- self->cfg = kiss_fftr_f32_alloc (len, (inverse) ? 1 : 0, NULL, NULL);
+ self = (GstFFTF32 *) g_malloc0 (memneeded);
+
+ self->cfg = (((guint8 *) self) + ALIGN_STRUCT (sizeof (GstFFTF32)));
+ self->cfg = kiss_fftr_f32_alloc (len, (inverse) ? 1 : 0, self->cfg, &subsize);
g_assert (self->cfg);
self->inverse = inverse;
@@ -168,7 +174,6 @@
void
gst_fft_f32_free (GstFFTF32 * self)
{
- kiss_fftr_f32_free (self->cfg);
g_free (self);
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/gstfftf64.c
--- a/gst_plugins_base/gst-libs/gst/fft/gstfftf64.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/gstfftf64.c Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
#include
#include
+#include "_kiss_fft_guts_f64.h"
#include "kiss_fftr_f64.h"
#include "gstfft.h"
#include "gstfftf64.h"
@@ -78,13 +79,18 @@
gst_fft_f64_new (gint len, gboolean inverse)
{
GstFFTF64 *self;
+ gsize subsize = 0, memneeded;
g_return_val_if_fail (len > 0, NULL);
g_return_val_if_fail (len % 2 == 0, NULL);
- self = g_new (GstFFTF64, 1);
+ kiss_fftr_f64_alloc (len, (inverse) ? 1 : 0, NULL, &subsize);
+ memneeded = ALIGN_STRUCT (sizeof (GstFFTF64)) + subsize;
- self->cfg = kiss_fftr_f64_alloc (len, (inverse) ? 1 : 0, NULL, NULL);
+ self = (GstFFTF64 *) g_malloc0 (memneeded);
+
+ self->cfg = (((guint8 *) self) + ALIGN_STRUCT (sizeof (GstFFTF64)));
+ self->cfg = kiss_fftr_f64_alloc (len, (inverse) ? 1 : 0, self->cfg, &subsize);
g_assert (self->cfg);
self->inverse = inverse;
@@ -168,7 +174,6 @@
void
gst_fft_f64_free (GstFFTF64 * self)
{
- kiss_fftr_f64_free (self->cfg);
g_free (self);
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/gstffts16.c
--- a/gst_plugins_base/gst-libs/gst/fft/gstffts16.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/gstffts16.c Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
#include
#include
+#include "_kiss_fft_guts_s16.h"
#include "kiss_fftr_s16.h"
#include "gstfft.h"
#include "gstffts16.h"
@@ -78,13 +79,18 @@
gst_fft_s16_new (gint len, gboolean inverse)
{
GstFFTS16 *self;
+ gsize subsize = 0, memneeded;
g_return_val_if_fail (len > 0, NULL);
g_return_val_if_fail (len % 2 == 0, NULL);
- self = g_new (GstFFTS16, 1);
+ kiss_fftr_s16_alloc (len, (inverse) ? 1 : 0, NULL, &subsize);
+ memneeded = ALIGN_STRUCT (sizeof (GstFFTS16)) + subsize;
- self->cfg = kiss_fftr_s16_alloc (len, (inverse) ? 1 : 0, NULL, NULL);
+ self = (GstFFTS16 *) g_malloc0 (memneeded);
+
+ self->cfg = (((guint8 *) self) + ALIGN_STRUCT (sizeof (GstFFTS16)));
+ self->cfg = kiss_fftr_s16_alloc (len, (inverse) ? 1 : 0, self->cfg, &subsize);
g_assert (self->cfg);
self->inverse = inverse;
@@ -168,7 +174,6 @@
void
gst_fft_s16_free (GstFFTS16 * self)
{
- kiss_fftr_s16_free (self->cfg);
g_free (self);
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/gstffts32.c
--- a/gst_plugins_base/gst-libs/gst/fft/gstffts32.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/gstffts32.c Wed Mar 24 18:04:17 2010 -0500
@@ -20,6 +20,7 @@
#include
#include
+#include "_kiss_fft_guts_s32.h"
#include "kiss_fftr_s32.h"
#include "gstfft.h"
#include "gstffts32.h"
@@ -77,13 +78,18 @@
gst_fft_s32_new (gint len, gboolean inverse)
{
GstFFTS32 *self;
+ gsize subsize = 0, memneeded;
g_return_val_if_fail (len > 0, NULL);
g_return_val_if_fail (len % 2 == 0, NULL);
- self = g_new (GstFFTS32, 1);
+ kiss_fftr_s32_alloc (len, (inverse) ? 1 : 0, NULL, &subsize);
+ memneeded = ALIGN_STRUCT (sizeof (GstFFTS32)) + subsize;
- self->cfg = kiss_fftr_s32_alloc (len, (inverse) ? 1 : 0, NULL, NULL);
+ self = (GstFFTS32 *) g_malloc0 (memneeded);
+
+ self->cfg = (((guint8 *) self) + ALIGN_STRUCT (sizeof (GstFFTS32)));
+ self->cfg = kiss_fftr_s32_alloc (len, (inverse) ? 1 : 0, self->cfg, &subsize);
g_assert (self->cfg);
self->inverse = inverse;
@@ -167,7 +173,6 @@
void
gst_fft_s32_free (GstFFTS32 * self)
{
- kiss_fftr_s32_free (self->cfg);
g_free (self);
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/kiss_fft_s16.h
--- a/gst_plugins_base/gst-libs/gst/fft/kiss_fft_s16.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/kiss_fft_s16.h Wed Mar 24 18:04:17 2010 -0500
@@ -26,7 +26,9 @@
#define KISS_FFT_S16_MALLOC g_malloc
-#include "machine/_stdint.h"
+#ifndef __SYMBIAN32__
+#include "_stdint.h"
+#endif
#define kiss_fft_s16_scalar int16_t
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/kiss_fft_s32.h
--- a/gst_plugins_base/gst-libs/gst/fft/kiss_fft_s32.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/kiss_fft_s32.h Wed Mar 24 18:04:17 2010 -0500
@@ -26,8 +26,9 @@
#define KISS_FFT_S32_MALLOC g_malloc
-
-#include "machine/_stdint.h"
+#ifndef __SYMBIAN32__
+#include "_stdint.h"
+#endif
#define kiss_fft_s32_scalar int32_t
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/kiss_fftr_f32.c
--- a/gst_plugins_base/gst-libs/gst/fft/kiss_fftr_f32.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/kiss_fftr_f32.c Wed Mar 24 18:04:17 2010 -0500
@@ -43,9 +43,8 @@
nfft >>= 1;
kiss_fft_f32_alloc (nfft, inverse_fft, NULL, &subsize);
- memneeded =
- sizeof (struct kiss_fftr_f32_state) + subsize +
- sizeof (kiss_fft_f32_cpx) * (nfft * 2);
+ memneeded = ALIGN_STRUCT (sizeof (struct kiss_fftr_f32_state))
+ + ALIGN_STRUCT (subsize) + sizeof (kiss_fft_f32_cpx) * (nfft * 2);
if (lenmem == NULL) {
st = (kiss_fftr_f32_cfg) KISS_FFT_F32_MALLOC (memneeded);
@@ -57,8 +56,9 @@
if (!st)
return NULL;
- st->substate = (kiss_fft_f32_cfg) (st + 1); /*just beyond kiss_fftr_f32_state struct */
- st->tmpbuf = (kiss_fft_f32_cpx *) (((char *) st->substate) + subsize);
+ st->substate = (kiss_fft_f32_cfg) (((char *) st) + ALIGN_STRUCT (sizeof (struct kiss_fftr_f32_state))); /*just beyond kiss_fftr_f32_state struct */
+ st->tmpbuf =
+ (kiss_fft_f32_cpx *) (((char *) st->substate) + ALIGN_STRUCT (subsize));
st->super_twiddles = st->tmpbuf + nfft;
kiss_fft_f32_alloc (nfft, inverse_fft, st->substate, &subsize);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/kiss_fftr_f64.c
--- a/gst_plugins_base/gst-libs/gst/fft/kiss_fftr_f64.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/kiss_fftr_f64.c Wed Mar 24 18:04:17 2010 -0500
@@ -43,9 +43,9 @@
nfft >>= 1;
kiss_fft_f64_alloc (nfft, inverse_fft, NULL, &subsize);
- memneeded =
- sizeof (struct kiss_fftr_f64_state) + subsize +
- sizeof (kiss_fft_f64_cpx) * (nfft * 2);
+ memneeded = ALIGN_STRUCT (sizeof (struct kiss_fftr_f64_state))
+ + ALIGN_STRUCT (subsize)
+ + sizeof (kiss_fft_f64_cpx) * (nfft * 2);
if (lenmem == NULL) {
st = (kiss_fftr_f64_cfg) KISS_FFT_F64_MALLOC (memneeded);
@@ -57,8 +57,9 @@
if (!st)
return NULL;
- st->substate = (kiss_fft_f64_cfg) (st + 1); /*just beyond kiss_fftr_f64_state struct */
- st->tmpbuf = (kiss_fft_f64_cpx *) (((char *) st->substate) + subsize);
+ st->substate = (kiss_fft_f64_cfg) (((char *) st) + ALIGN_STRUCT (sizeof (struct kiss_fftr_f64_state))); /*just beyond kiss_fftr_f64_state struct */
+ st->tmpbuf =
+ (kiss_fft_f64_cpx *) (((char *) st->substate) + ALIGN_STRUCT (subsize));
st->super_twiddles = st->tmpbuf + nfft;
kiss_fft_f64_alloc (nfft, inverse_fft, st->substate, &subsize);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/kiss_fftr_s16.c
--- a/gst_plugins_base/gst-libs/gst/fft/kiss_fftr_s16.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/kiss_fftr_s16.c Wed Mar 24 18:04:17 2010 -0500
@@ -43,9 +43,9 @@
nfft >>= 1;
kiss_fft_s16_alloc (nfft, inverse_fft, NULL, &subsize);
- memneeded =
- sizeof (struct kiss_fftr_s16_state) + subsize +
- sizeof (kiss_fft_s16_cpx) * (nfft * 2);
+ memneeded = ALIGN_STRUCT (sizeof (struct kiss_fftr_s16_state))
+ + ALIGN_STRUCT (subsize)
+ + sizeof (kiss_fft_s16_cpx) * (nfft * 2);
if (lenmem == NULL) {
st = (kiss_fftr_s16_cfg) KISS_FFT_S16_MALLOC (memneeded);
@@ -57,8 +57,9 @@
if (!st)
return NULL;
- st->substate = (kiss_fft_s16_cfg) (st + 1); /*just beyond kiss_fftr_s16_state struct */
- st->tmpbuf = (kiss_fft_s16_cpx *) (((char *) st->substate) + subsize);
+ st->substate = (kiss_fft_s16_cfg) (((char *) st) + ALIGN_STRUCT (sizeof (struct kiss_fftr_s16_state))); /*just beyond kiss_fftr_s16_state struct */
+ st->tmpbuf =
+ (kiss_fft_s16_cpx *) (((char *) st->substate) + ALIGN_STRUCT (subsize));
st->super_twiddles = st->tmpbuf + nfft;
kiss_fft_s16_alloc (nfft, inverse_fft, st->substate, &subsize);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/kiss_fftr_s32.c
--- a/gst_plugins_base/gst-libs/gst/fft/kiss_fftr_s32.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/fft/kiss_fftr_s32.c Wed Mar 24 18:04:17 2010 -0500
@@ -43,9 +43,9 @@
nfft >>= 1;
kiss_fft_s32_alloc (nfft, inverse_fft, NULL, &subsize);
- memneeded =
- sizeof (struct kiss_fftr_s32_state) + subsize +
- sizeof (kiss_fft_s32_cpx) * (nfft * 2);
+ memneeded = ALIGN_STRUCT (sizeof (struct kiss_fftr_s32_state))
+ + ALIGN_STRUCT (subsize)
+ + sizeof (kiss_fft_s32_cpx) * (nfft * 2);
if (lenmem == NULL) {
st = (kiss_fftr_s32_cfg) KISS_FFT_S32_MALLOC (memneeded);
@@ -57,8 +57,9 @@
if (!st)
return NULL;
- st->substate = (kiss_fft_s32_cfg) (st + 1); /*just beyond kiss_fftr_s32_state struct */
- st->tmpbuf = (kiss_fft_s32_cpx *) (((char *) st->substate) + subsize);
+ st->substate = (kiss_fft_s32_cfg) (((char *) st) + ALIGN_STRUCT (sizeof (struct kiss_fftr_s32_state))); /*just beyond kiss_fftr_s32_state struct */
+ st->tmpbuf =
+ (kiss_fft_s32_cpx *) (((char *) st->substate) + ALIGN_STRUCT (subsize));
st->super_twiddles = st->tmpbuf + nfft;
kiss_fft_s32_alloc (nfft, inverse_fft, st->substate, &subsize);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/fft/kiss_version
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/fft/kiss_version Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,4 @@
+Based on Kiss FFT version 1.2.6. http://kissfft.sourceforge.net
+
+Only changes are limitation to one data type for each version in
+kiss_fft.h and _kiss_fft_guts.h.
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/floatcast/floatcast.h
--- a/gst_plugins_base/gst-libs/gst/floatcast/floatcast.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/floatcast/floatcast.h Wed Mar 24 18:04:17 2010 -0500
@@ -40,8 +40,7 @@
#define __FLOATCAST_H__
#include
-#include
-#include /* to make sure inline is defined properly */
+#include
#if defined (_MSC_VER) && !defined (inline)
#define inline __inline
@@ -97,128 +96,6 @@
#endif
-/* FIXME 0.11: don't use GLib namespace (GDOUBLE_SWAP_LE_BE, GFLOAT_TO_LE,
- * GFLOAT_TO_BE, GDOUBLE_TO_LE, GDOUBLE_TO_BE) */
-
-/**
- * GFLOAT_SWAP_LE_BE:
- * @in: input value
- *
- * Swap byte order of a 32-bit floating point value (float).
- */
-inline static gfloat
-GFLOAT_SWAP_LE_BE(gfloat in)
-{
- union
- {
- guint32 i;
- gfloat f;
- } u;
-
- u.f = in;
- u.i = GUINT32_SWAP_LE_BE (u.i);
- return u.f;
-}
-
-/**
- * GDOUBLE_SWAP_LE_BE:
- * @in: input value
- *
- * Swap byte order of a 64-bit floating point value (double).
- */
-inline static gdouble
-GDOUBLE_SWAP_LE_BE(gdouble in)
-{
- union
- {
- guint64 i;
- gdouble d;
- } u;
-
- u.d = in;
- u.i = GUINT64_SWAP_LE_BE (u.i);
- return u.d;
-}
-
-/**
- * GDOUBLE_TO_LE:
- * @val: value
- *
- * Convert 64-bit floating point value (double) from native byte order into
- * little endian byte order.
- */
-/**
- * GDOUBLE_TO_BE:
- * @val: value
- *
- * Convert 64-bit floating point value (double) from native byte order into
- * big endian byte order.
- */
-/**
- * GDOUBLE_FROM_LE:
- * @val: value
- *
- * Convert 64-bit floating point value (double) from little endian byte order
- * into native byte order.
- */
-/**
- * GDOUBLE_FROM_BE:
- * @val: value
- *
- * Convert 64-bit floating point value (double) from big endian byte order
- * into native byte order.
- */
-
-/**
- * GFLOAT_TO_LE:
- * @val: value
- *
- * Convert 32-bit floating point value (float) from native byte order into
- * little endian byte order.
- */
-/**
- * GFLOAT_TO_BE:
- * @val: value
- *
- * Convert 32-bit floating point value (float) from native byte order into
- * big endian byte order.
- */
-/**
- * GFLOAT_FROM_LE:
- * @val: value
- *
- * Convert 32-bit floating point value (float) from little endian byte order
- * into native byte order.
- */
-/**
- * GFLOAT_FROM_BE:
- * @val: value
- *
- * Convert 32-bit floating point value (float) from big endian byte order
- * into native byte order.
- */
-
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define GFLOAT_TO_LE(val) ((gfloat) (val))
-#define GFLOAT_TO_BE(val) (GFLOAT_SWAP_LE_BE (val))
-#define GDOUBLE_TO_LE(val) ((gdouble) (val))
-#define GDOUBLE_TO_BE(val) (GDOUBLE_SWAP_LE_BE (val))
-
-#elif G_BYTE_ORDER == G_BIG_ENDIAN
-#define GFLOAT_TO_LE(val) (GFLOAT_SWAP_LE_BE (val))
-#define GFLOAT_TO_BE(val) ((gfloat) (val))
-#define GDOUBLE_TO_LE(val) (GDOUBLE_SWAP_LE_BE (val))
-#define GDOUBLE_TO_BE(val) ((gdouble) (val))
-
-#else /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */
-#error unknown ENDIAN type
-#endif /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */
-
-#define GFLOAT_FROM_LE(val) (GFLOAT_TO_LE (val))
-#define GFLOAT_FROM_BE(val) (GFLOAT_TO_BE (val))
-#define GDOUBLE_FROM_LE(val) (GDOUBLE_TO_LE (val))
-#define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val))
-
G_END_DECLS
#endif /* __FLOATCAST_H__ */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/colorbalance.c
--- a/gst_plugins_base/gst-libs/gst/interfaces/colorbalance.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/colorbalance.c Wed Mar 24 18:04:17 2010 -0500
@@ -30,6 +30,15 @@
/**
* SECTION:gstcolorbalance
* @short_description: Interface for adjusting color balance settings
+ *
+ *
+ * This interface is implemented by elements which can perform some color
+ * balance operation on video frames they process. For example, modifying
+ * the brightness, contrast, hue or saturation.
+ *
+ * Example elements are 'xvimagesink' and 'colorbalance'
+ *
+ *
*/
enum
@@ -79,6 +88,14 @@
static gboolean initialized = FALSE;
if (!initialized) {
+ /**
+ * GstColorBalance::value-changed:
+ * @colorbalance: The GstColorBalance instance
+ * @channel: The #GstColorBalanceChannel
+ * @value: The new value
+ *
+ * Fired when the value of the indicated channel has changed.
+ */
gst_color_balance_signals[VALUE_CHANGED] =
g_signal_new ("value-changed",
GST_TYPE_COLOR_BALANCE, G_SIGNAL_RUN_LAST,
@@ -97,11 +114,21 @@
klass->set_value = NULL;
klass->get_value = NULL;
}
+
+/**
+ * gst_color_balance_list_channels:
+ * @balance: A #GstColorBalance instance
+ *
+ * Retrieve a list of the available channels.
+ *
+ * Returns: A GList containing pointers to #GstColorBalanceChannel objects.
+ * The list is owned by the #GstColorBalance instance and must not
+ * be freed.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
const GList *
gst_color_balance_list_channels (GstColorBalance * balance)
{
@@ -113,11 +140,24 @@
return NULL;
}
+
+/**
+ * gst_color_balance_set_value:
+ * @balance: A #GstColorBalance instance
+ * @channel: A #GstColorBalanceChannel instance
+ * @value: The new value for the channel.
+ *
+ * Sets the current value of the channel to the passed value, which must
+ * be between min_value and max_value.
+ *
+ * See Also: The #GstColorBalanceChannel::min_value and
+ * #GstColorBalanceChannel::max_value members of the
+ * #GstColorBalanceChannel object.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_color_balance_set_value (GstColorBalance * balance,
GstColorBalanceChannel * channel, gint value)
@@ -128,11 +168,25 @@
klass->set_value (balance, channel, value);
}
}
+
+/**
+ * gst_color_balance_get_value:
+ * @balance: A #GstColorBalance instance
+ * @channel: A #GstColorBalanceChannel instance
+ *
+ * Retrieve the current value of the indicated channel, between min_value
+ * and max_value.
+ *
+ * See Also: The #GstColorBalanceChannel::min_value and
+ * #GstColorBalanceChannel::max_value members of the
+ * #GstColorBalanceChannel object.
+ *
+ * Returns: The current value of the channel.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
gint
gst_color_balance_get_value (GstColorBalance * balance,
GstColorBalanceChannel * channel)
@@ -145,11 +199,45 @@
return channel->min_value;
}
+
+/**
+ * gst_color_balance_get_balance_type:
+ * @balance: The #GstColorBalance implementation
+ *
+ * Get the #GstColorBalanceType of this implementation.
+ *
+ * Returns: A the #GstColorBalanceType.
+ *
+ * Since: 0.10.24
+ */
+
+ #ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstColorBalanceType
+gst_color_balance_get_balance_type (GstColorBalance * balance)
+{
+ GstColorBalanceClass *klass = GST_COLOR_BALANCE_GET_CLASS (balance);
+
+ return klass->balance_type;
+}
+
+/**
+ * gst_color_balance_value_changed:
+ * @balance: A #GstColorBalance instance
+ * @channel: A #GstColorBalanceChannel whose value has changed
+ * @value: The new value of the channel
+ *
+ * A helper function called by implementations of the GstColorBalance
+ * interface. It fires the #GstColorBalance::value-changed signal on the
+ * instance, and the #GstColorBalanceChannel::value-changed signal on the
+ * channel object.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_color_balance_value_changed (GstColorBalance * balance,
GstColorBalanceChannel * channel, gint value)
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/colorbalance.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/colorbalance.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/colorbalance.h Wed Mar 24 18:04:17 2010 -0500
@@ -46,14 +46,27 @@
#define GST_COLOR_BALANCE_TYPE(klass) (klass->balance_type)
typedef struct _GstColorBalance GstColorBalance;
+typedef struct _GstColorBalanceClass GstColorBalanceClass;
+/**
+ * GstColorBalanceType:
+ * @GST_COLOR_BALANCE_HARDWARE: Color balance is implemented with dedicated
+ * hardware.
+ * @GST_COLOR_BALANCE_SOFTWARE: Color balance is implemented via software
+ * processing.
+ *
+ * An enumeration indicating whether an element implements color balancing
+ * operations in software or in dedicated hardware. In general, dedicated
+ * hardware implementations (such as those provided by xvimagesink) are
+ * preferred.
+ */
typedef enum
{
GST_COLOR_BALANCE_HARDWARE,
GST_COLOR_BALANCE_SOFTWARE
} GstColorBalanceType;
-typedef struct _GstColorBalanceClass {
+struct _GstColorBalanceClass {
GTypeInterface klass;
GstColorBalanceType balance_type;
@@ -73,7 +86,7 @@
gint value);
gpointer _gst_reserved[GST_PADDING];
-} GstColorBalanceClass;
+};
#ifdef __SYMBIAN32__
IMPORT_C
#endif
@@ -101,6 +114,12 @@
gint gst_color_balance_get_value (GstColorBalance *balance,
GstColorBalanceChannel *channel);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+GstColorBalanceType
+ gst_color_balance_get_balance_type (GstColorBalance *balance);
/* trigger signal */
#ifdef __SYMBIAN32__
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/colorbalancechannel.c
--- a/gst_plugins_base/gst-libs/gst/interfaces/colorbalancechannel.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/colorbalancechannel.c Wed Mar 24 18:04:17 2010 -0500
@@ -25,6 +25,17 @@
#include "colorbalancechannel.h"
+/**
+ * SECTION:gstcolorbalancechannel
+ * @short_description: Object representing a channel from the #GstColorBalance
+ * interface.
+ *
+ * The #GstColorBalanceChannel object represents a parameter
+ * for modifying the color balance implemented by an element providing the
+ * #GstColorBalance interface. For example, Hue or Saturation.
+ *
+ */
+
enum
{
/* FILL ME */
@@ -78,6 +89,13 @@
parent_class = g_type_class_peek_parent (klass);
+ /**
+ * GstColorBalanceChannel::value-changed:
+ * @channel: The #GstColorBalanceChannel
+ * @value: The new value
+ *
+ * Fired when the value of the indicated channel has changed.
+ */
signals[SIGNAL_VALUE_CHANGED] =
g_signal_new ("value-changed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/colorbalancechannel.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/colorbalancechannel.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/colorbalancechannel.h Wed Mar 24 18:04:17 2010 -0500
@@ -39,15 +39,26 @@
#define GST_IS_COLOR_BALANCE_CHANNEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE_CHANNEL))
-typedef struct _GstColorBalanceChannel {
+typedef struct _GstColorBalanceChannel GstColorBalanceChannel;
+typedef struct _GstColorBalanceChannelClass GstColorBalanceChannelClass;
+
+/**
+ * GstColorBalanceChannel:
+ * @label: A string containing a descriptive name for this channel
+ * @min_value: The minimum valid value for this channel.
+ * @max_value: The maximum valid value for this channel.
+ */
+struct _GstColorBalanceChannel {
GObject parent;
+ /*< public >*/
gchar *label;
- gint min_value,
- max_value;
-} GstColorBalanceChannel;
+ gint min_value;
+ gint max_value;
+};
-typedef struct _GstColorBalanceChannelClass {
+
+struct _GstColorBalanceChannelClass {
GObjectClass parent;
/* signals */
@@ -55,7 +66,7 @@
gint value);
gpointer _gst_reserved[GST_PADDING];
-} GstColorBalanceChannelClass;
+};
#ifdef __SYMBIAN32__
IMPORT_C
#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/interfaces-enumtypes.c
--- a/gst_plugins_base/gst-libs/gst/interfaces/interfaces-enumtypes.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/interfaces-enumtypes.c Wed Mar 24 18:04:17 2010 -0500
@@ -24,16 +24,17 @@
GType
gst_color_balance_type_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
static const GEnumValue values[] = {
{ GST_COLOR_BALANCE_HARDWARE, "GST_COLOR_BALANCE_HARDWARE", "hardware" },
{ GST_COLOR_BALANCE_SOFTWARE, "GST_COLOR_BALANCE_SOFTWARE", "software" },
{ 0, NULL, NULL }
};
- etype = g_enum_register_static ("GstColorBalanceType", values);
+ GType g_define_type_id = g_enum_register_static ("GstColorBalanceType", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
- return etype;
+ return g_define_type_id__volatile;
}
/* enumerations from "mixer.h" */
@@ -44,16 +45,17 @@
GType
gst_mixer_type_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
static const GEnumValue values[] = {
{ GST_MIXER_HARDWARE, "GST_MIXER_HARDWARE", "hardware" },
{ GST_MIXER_SOFTWARE, "GST_MIXER_SOFTWARE", "software" },
{ 0, NULL, NULL }
};
- etype = g_enum_register_static ("GstMixerType", values);
+ GType g_define_type_id = g_enum_register_static ("GstMixerType", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
- return etype;
+ return g_define_type_id__volatile;
}
#ifdef __SYMBIAN32__
EXPORT_C
@@ -62,8 +64,8 @@
GType
gst_mixer_message_type_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
static const GEnumValue values[] = {
{ GST_MIXER_MESSAGE_INVALID, "GST_MIXER_MESSAGE_INVALID", "invalid" },
{ GST_MIXER_MESSAGE_MUTE_TOGGLED, "GST_MIXER_MESSAGE_MUTE_TOGGLED", "mute-toggled" },
@@ -74,9 +76,10 @@
{ GST_MIXER_MESSAGE_MIXER_CHANGED, "GST_MIXER_MESSAGE_MIXER_CHANGED", "mixer-changed" },
{ 0, NULL, NULL }
};
- etype = g_enum_register_static ("GstMixerMessageType", values);
+ GType g_define_type_id = g_enum_register_static ("GstMixerMessageType", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
- return etype;
+ return g_define_type_id__volatile;
}
#ifdef __SYMBIAN32__
EXPORT_C
@@ -85,16 +88,19 @@
GType
gst_mixer_flags_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
static const GFlagsValue values[] = {
{ GST_MIXER_FLAG_NONE, "GST_MIXER_FLAG_NONE", "none" },
{ GST_MIXER_FLAG_AUTO_NOTIFICATIONS, "GST_MIXER_FLAG_AUTO_NOTIFICATIONS", "auto-notifications" },
+ { GST_MIXER_FLAG_HAS_WHITELIST, "GST_MIXER_FLAG_HAS_WHITELIST", "has-whitelist" },
+ { GST_MIXER_FLAG_GROUPING, "GST_MIXER_FLAG_GROUPING", "grouping" },
{ 0, NULL, NULL }
};
- etype = g_flags_register_static ("GstMixerFlags", values);
+ GType g_define_type_id = g_flags_register_static ("GstMixerFlags", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
- return etype;
+ return g_define_type_id__volatile;
}
/* enumerations from "mixertrack.h" */
@@ -105,8 +111,8 @@
GType
gst_mixer_track_flags_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
static const GFlagsValue values[] = {
{ GST_MIXER_TRACK_INPUT, "GST_MIXER_TRACK_INPUT", "input" },
{ GST_MIXER_TRACK_OUTPUT, "GST_MIXER_TRACK_OUTPUT", "output" },
@@ -114,11 +120,114 @@
{ GST_MIXER_TRACK_RECORD, "GST_MIXER_TRACK_RECORD", "record" },
{ GST_MIXER_TRACK_MASTER, "GST_MIXER_TRACK_MASTER", "master" },
{ GST_MIXER_TRACK_SOFTWARE, "GST_MIXER_TRACK_SOFTWARE", "software" },
+ { GST_MIXER_TRACK_NO_RECORD, "GST_MIXER_TRACK_NO_RECORD", "no-record" },
+ { GST_MIXER_TRACK_NO_MUTE, "GST_MIXER_TRACK_NO_MUTE", "no-mute" },
+ { GST_MIXER_TRACK_WHITELIST, "GST_MIXER_TRACK_WHITELIST", "whitelist" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_flags_register_static ("GstMixerTrackFlags", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+
+/* enumerations from "navigation.h" */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GType
+gst_navigation_command_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_NAVIGATION_COMMAND_INVALID, "GST_NAVIGATION_COMMAND_INVALID", "invalid" },
+ { GST_NAVIGATION_COMMAND_MENU1, "GST_NAVIGATION_COMMAND_MENU1", "menu1" },
+ { GST_NAVIGATION_COMMAND_MENU2, "GST_NAVIGATION_COMMAND_MENU2", "menu2" },
+ { GST_NAVIGATION_COMMAND_MENU3, "GST_NAVIGATION_COMMAND_MENU3", "menu3" },
+ { GST_NAVIGATION_COMMAND_MENU4, "GST_NAVIGATION_COMMAND_MENU4", "menu4" },
+ { GST_NAVIGATION_COMMAND_MENU5, "GST_NAVIGATION_COMMAND_MENU5", "menu5" },
+ { GST_NAVIGATION_COMMAND_MENU6, "GST_NAVIGATION_COMMAND_MENU6", "menu6" },
+ { GST_NAVIGATION_COMMAND_MENU7, "GST_NAVIGATION_COMMAND_MENU7", "menu7" },
+ { GST_NAVIGATION_COMMAND_LEFT, "GST_NAVIGATION_COMMAND_LEFT", "left" },
+ { GST_NAVIGATION_COMMAND_RIGHT, "GST_NAVIGATION_COMMAND_RIGHT", "right" },
+ { GST_NAVIGATION_COMMAND_UP, "GST_NAVIGATION_COMMAND_UP", "up" },
+ { GST_NAVIGATION_COMMAND_DOWN, "GST_NAVIGATION_COMMAND_DOWN", "down" },
+ { GST_NAVIGATION_COMMAND_ACTIVATE, "GST_NAVIGATION_COMMAND_ACTIVATE", "activate" },
+ { GST_NAVIGATION_COMMAND_PREV_ANGLE, "GST_NAVIGATION_COMMAND_PREV_ANGLE", "prev-angle" },
+ { GST_NAVIGATION_COMMAND_NEXT_ANGLE, "GST_NAVIGATION_COMMAND_NEXT_ANGLE", "next-angle" },
{ 0, NULL, NULL }
};
- etype = g_flags_register_static ("GstMixerTrackFlags", values);
+ GType g_define_type_id = g_enum_register_static ("GstNavigationCommand", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GType
+gst_navigation_query_type_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_NAVIGATION_QUERY_INVALID, "GST_NAVIGATION_QUERY_INVALID", "invalid" },
+ { GST_NAVIGATION_QUERY_COMMANDS, "GST_NAVIGATION_QUERY_COMMANDS", "commands" },
+ { GST_NAVIGATION_QUERY_ANGLES, "GST_NAVIGATION_QUERY_ANGLES", "angles" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstNavigationQueryType", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
- return etype;
+ return g_define_type_id__volatile;
+}
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GType
+gst_navigation_message_type_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_NAVIGATION_MESSAGE_INVALID, "GST_NAVIGATION_MESSAGE_INVALID", "invalid" },
+ { GST_NAVIGATION_MESSAGE_MOUSE_OVER, "GST_NAVIGATION_MESSAGE_MOUSE_OVER", "mouse-over" },
+ { GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED, "GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED", "commands-changed" },
+ { GST_NAVIGATION_MESSAGE_ANGLES_CHANGED, "GST_NAVIGATION_MESSAGE_ANGLES_CHANGED", "angles-changed" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstNavigationMessageType", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GType
+gst_navigation_event_type_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_NAVIGATION_EVENT_INVALID, "GST_NAVIGATION_EVENT_INVALID", "invalid" },
+ { GST_NAVIGATION_EVENT_KEY_PRESS, "GST_NAVIGATION_EVENT_KEY_PRESS", "key-press" },
+ { GST_NAVIGATION_EVENT_KEY_RELEASE, "GST_NAVIGATION_EVENT_KEY_RELEASE", "key-release" },
+ { GST_NAVIGATION_EVENT_MOUSE_BUTTON_PRESS, "GST_NAVIGATION_EVENT_MOUSE_BUTTON_PRESS", "mouse-button-press" },
+ { GST_NAVIGATION_EVENT_MOUSE_BUTTON_RELEASE, "GST_NAVIGATION_EVENT_MOUSE_BUTTON_RELEASE", "mouse-button-release" },
+ { GST_NAVIGATION_EVENT_MOUSE_MOVE, "GST_NAVIGATION_EVENT_MOUSE_MOVE", "mouse-move" },
+ { GST_NAVIGATION_EVENT_COMMAND, "GST_NAVIGATION_EVENT_COMMAND", "command" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstNavigationEventType", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
}
/* enumerations from "tunerchannel.h" */
@@ -129,8 +238,8 @@
GType
gst_tuner_channel_flags_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
static const GFlagsValue values[] = {
{ GST_TUNER_CHANNEL_INPUT, "GST_TUNER_CHANNEL_INPUT", "input" },
{ GST_TUNER_CHANNEL_OUTPUT, "GST_TUNER_CHANNEL_OUTPUT", "output" },
@@ -138,9 +247,10 @@
{ GST_TUNER_CHANNEL_AUDIO, "GST_TUNER_CHANNEL_AUDIO", "audio" },
{ 0, NULL, NULL }
};
- etype = g_flags_register_static ("GstTunerChannelFlags", values);
+ GType g_define_type_id = g_flags_register_static ("GstTunerChannelFlags", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
- return etype;
+ return g_define_type_id__volatile;
}
/* Generated data ends here */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/interfaces-enumtypes.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/interfaces-enumtypes.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/interfaces-enumtypes.h Wed Mar 24 18:04:17 2010 -0500
@@ -36,6 +36,20 @@
GType gst_mixer_track_flags_get_type (void);
#define GST_TYPE_MIXER_TRACK_FLAGS (gst_mixer_track_flags_get_type())
+/* enumerations from "navigation.h" */
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+GType gst_navigation_command_get_type (void);
+#define GST_TYPE_NAVIGATION_COMMAND (gst_navigation_command_get_type())
+GType gst_navigation_query_type_get_type (void);
+#define GST_TYPE_NAVIGATION_QUERY_TYPE (gst_navigation_query_type_get_type())
+GType gst_navigation_message_type_get_type (void);
+#define GST_TYPE_NAVIGATION_MESSAGE_TYPE (gst_navigation_message_type_get_type())
+GType gst_navigation_event_type_get_type (void);
+#define GST_TYPE_NAVIGATION_EVENT_TYPE (gst_navigation_event_type_get_type())
+
/* enumerations from "tunerchannel.h" */
#ifdef __SYMBIAN32__
IMPORT_C
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/mixer.c
--- a/gst_plugins_base/gst-libs/gst/interfaces/mixer.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/mixer.c Wed Mar 24 18:04:17 2010 -0500
@@ -143,6 +143,8 @@
* it is allowed to only provide input elements in this list.
*
* Returns: A #GList consisting of zero or more #GstMixerTracks.
+ * The list is owned by the #GstMixer instance and must not be freed
+ * or modified.
*/
#ifdef __SYMBIAN32__
EXPORT_C
@@ -354,6 +356,28 @@
}
/**
+ * gst_mixer_get_mixer_type:
+ * @mixer: The #GstMixer implementation
+ *
+ * Get the #GstMixerType of this mixer implementation.
+ *
+ * Returns: A the #GstMixerType.
+ *
+ * Since: 0.10.24
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstMixerType
+gst_mixer_get_mixer_type (GstMixer * mixer)
+{
+ GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
+
+ return klass->mixer_type;
+}
+
+/**
* gst_mixer_get_mixer_flags:
* @mixer: The #GstMixer implementation
*
@@ -655,7 +679,7 @@
* message and return the GstMixerMessageType identifying which
* type of notification it is.
*
- * Returns: The type of the GstMixerMessage, or GST_MIXER_MESSAGE_NONE
+ * Returns: The type of the GstMixerMessage, or GST_MIXER_MESSAGE_INVALID
* if the message is not a GstMixer notification.
*
* Since: 0.10.14
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/mixer.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/mixer.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/mixer.h Wed Mar 24 18:04:17 2010 -0500
@@ -85,18 +85,26 @@
/**
* GstMixerFlags:
* @GST_MIXER_FLAG_NONE: No flags
- * @GST_MIXER_FLAG_AUTO_NOTIFICATIONS: The mixer implementation automatically sends
- * notification messages.
+ * @GST_MIXER_FLAG_AUTO_NOTIFICATIONS: The mixer implementation automatically
+ * sends notification messages.
+ * @GST_MIXER_FLAG_HAS_WHITELIST: The mixer implementation flags tracks that
+ * should be displayed by default (whitelisted). Since: 0.10.23
+ * @GST_MIXER_FLAG_GROUPING: The mixer implementation will leave some controls
+ * marked without either input or output. Controls marked as input or
+ * output should be grouped with input & output sliders, even if they
+ * are options or bare switches. Since: 0.10.23
*
- * Flags for supported features. Whether the element automatically sends
- * notifications on the bus is the only one for now.
+ * Flags indicating which optional features are supported by a mixer
+ * implementation.
*
* Since: 0.10.14
*/
typedef enum
{
GST_MIXER_FLAG_NONE = 0,
- GST_MIXER_FLAG_AUTO_NOTIFICATIONS = (1<<0)
+ GST_MIXER_FLAG_AUTO_NOTIFICATIONS = (1<<0),
+ GST_MIXER_FLAG_HAS_WHITELIST = (1<<1),
+ GST_MIXER_FLAG_GROUPING = (1<<2),
} GstMixerFlags;
struct _GstMixerClass {
@@ -250,11 +258,15 @@
void gst_mixer_options_list_changed (GstMixer *mixer,
- GstMixerOptions *opts);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
+ GstMixerOptions *opts);
+GstMixerType gst_mixer_get_mixer_type (GstMixer *mixer);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
GstMixerFlags gst_mixer_get_mixer_flags (GstMixer *mixer);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/mixertrack.c
--- a/gst_plugins_base/gst-libs/gst/interfaces/mixertrack.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/mixertrack.c Wed Mar 24 18:04:17 2010 -0500
@@ -41,6 +41,7 @@
ARG_0,
ARG_LABEL,
ARG_UNTRANSLATED_LABEL,
+ ARG_INDEX,
ARG_MIN_VOLUME,
ARG_MAX_VOLUME,
ARG_FLAGS,
@@ -102,7 +103,7 @@
g_object_class_install_property (object_klass, ARG_LABEL,
g_param_spec_string ("label", "Track label",
"The label assigned to the track (may be translated)", NULL,
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
/**
* GstMixerTrack:untranslated-label
@@ -118,27 +119,42 @@
g_object_class_install_property (object_klass, ARG_UNTRANSLATED_LABEL,
g_param_spec_string ("untranslated-label", "Untranslated track label",
"The untranslated label assigned to the track (since 0.10.13)",
- NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ NULL,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
+
+ /**
+ * GstMixerTrack:index
+ *
+ * Index of the mixer track, if available. Mixer track implementations
+ * must set this at construct time. This can be used to discern between
+ * multiple tracks with identical labels.
+ *
+ * Since: 0.10.21
+ */
+ g_object_class_install_property (object_klass, ARG_INDEX,
+ g_param_spec_uint ("index", "Index",
+ "Track index", 0, G_MAXUINT,
+ 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_klass, ARG_MIN_VOLUME,
- g_param_spec_int ("min_volume", "Minimum volume level",
+ g_param_spec_int ("min-volume", "Minimum volume level",
"The minimum possible volume level", G_MININT, G_MAXINT,
- 0, G_PARAM_READABLE));
+ 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_klass, ARG_MAX_VOLUME,
- g_param_spec_int ("max_volume", "Maximum volume level",
+ g_param_spec_int ("max-volume", "Maximum volume level",
"The maximum possible volume level", G_MININT, G_MAXINT,
- 0, G_PARAM_READABLE));
+ 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_klass, ARG_FLAGS,
g_param_spec_uint ("flags", "Flags",
"Flags indicating the type of mixer track",
- 0, G_MAXUINT, 0, G_PARAM_READABLE));
+ 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_klass, ARG_NUM_CHANNELS,
- g_param_spec_int ("num_channels", "Number of channels",
+ g_param_spec_int ("num-channels", "Number of channels",
"The number of channels contained within the track",
- 0, G_MAXINT, 0, G_PARAM_READABLE));
+ 0, G_MAXINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
#if 0
signals[SIGNAL_RECORD_TOGGLED] =
@@ -176,8 +192,9 @@
mixer_track->num_channels = 0;
}
-/* FIXME 0.11: move this as a member into the mixer track structure */
+/* FIXME 0.11: move these as members into the mixer track structure */
#define MIXER_TRACK_OBJECT_DATA_KEY_UNTRANSLATED_LABEL "gst-mixer-track-ulabel"
+#define MIXER_TRACK_OBJECT_DATA_KEY_INDEX "index"
static void
gst_mixer_track_get_property (GObject * object, guint prop_id, GValue * value,
@@ -196,6 +213,11 @@
(const gchar *) g_object_get_data (G_OBJECT (mixer_track),
MIXER_TRACK_OBJECT_DATA_KEY_UNTRANSLATED_LABEL));
break;
+ case ARG_INDEX:
+ g_value_set_uint (value,
+ GPOINTER_TO_INT (g_object_get_data (G_OBJECT (mixer_track),
+ MIXER_TRACK_OBJECT_DATA_KEY_INDEX)));
+ break;
case ARG_MIN_VOLUME:
g_value_set_int (value, mixer_track->min_volume);
break;
@@ -228,6 +250,11 @@
MIXER_TRACK_OBJECT_DATA_KEY_UNTRANSLATED_LABEL,
g_value_dup_string (value), (GDestroyNotify) g_free);
break;
+ case ARG_INDEX:
+ g_object_set_data (G_OBJECT (mixer_track),
+ MIXER_TRACK_OBJECT_DATA_KEY_INDEX,
+ GINT_TO_POINTER (g_value_get_uint (value)));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/mixertrack.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/mixertrack.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/mixertrack.h Wed Mar 24 18:04:17 2010 -0500
@@ -54,14 +54,34 @@
* mixer, which means that setting this track will change
* the hearable volume on any output.
*/
-
+/**
+ * GstMixerTrackFlags:
+ * @GST_MIXER_TRACK_INPUT: mixer track is for input
+ * @GST_MIXER_TRACK_OUTPUT: mixer track is for output
+ * @GST_MIXER_TRACK_MUTE: input or output is muted
+ * @GST_MIXER_TRACK_RECORD: input is audible in speakers attached to output
+ * (for #GST_MIXER_TRACK_INPUT mixer tracks only)
+ * @GST_MIXER_TRACK_MASTER: this mixer track is likely to be the master control
+ * @GST_MIXER_TRACK_SOFTWARE: mixer track's' volume control is implemented
+ * in software (as opposed to a hardware control)
+ * @GST_MIXER_TRACK_NO_RECORD: input track lacks support for recordable.
+ * Since: 0.10.23
+ * @GST_MIXER_TRACK_NO_MUTE: play track doesn't support mute. Since: 0.10.23
+ * @GST_MIXER_TRACK_WHITELIST: track should be displayed "by default" in apps.
+ * Since: 0.10.23
+ *
+ * Mixer track flags.
+ */
typedef enum {
GST_MIXER_TRACK_INPUT = (1<<0),
GST_MIXER_TRACK_OUTPUT = (1<<1),
GST_MIXER_TRACK_MUTE = (1<<2),
GST_MIXER_TRACK_RECORD = (1<<3),
GST_MIXER_TRACK_MASTER = (1<<4),
- GST_MIXER_TRACK_SOFTWARE = (1<<5)
+ GST_MIXER_TRACK_SOFTWARE = (1<<5),
+ GST_MIXER_TRACK_NO_RECORD = (1<<6),
+ GST_MIXER_TRACK_NO_MUTE = (1<<7),
+ GST_MIXER_TRACK_WHITELIST = (1<<8),
} GstMixerTrackFlags;
#define GST_MIXER_TRACK_HAS_FLAG(channel, flag) \
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/navigation.c
--- a/gst_plugins_base/gst-libs/gst/interfaces/navigation.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/navigation.c Wed Mar 24 18:04:17 2010 -0500
@@ -1,7 +1,8 @@
/* GStreamer Navigation
* Copyright (C) 2003 Ronald Bultje
+ * Copyright (C) 2007-2009 Jan Schmidt
*
- * navigation.c: navigation design virtual class function wrappers
+ * navigation.c: navigation event virtual class function wrappers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -19,18 +20,62 @@
* Boston, MA 02111-1307, USA.
*/
+/**
+ * SECTION:gstnavigation
+ * @short_description: Interface for creating, sending and parsing navigation
+ * events.
+ *
+ * The Navigation interface is used for creating and injecting navigation related
+ * events such as mouse button presses, cursor motion and key presses. The associated
+ * library also provides methods for parsing received events, and for sending and
+ * receiving navigation related bus events. One main usecase is DVD menu navigation.
+ *
+ * The main parts of the API are:
+ *
+ *
+ *
+ * The GstNavigation interface, implemented by elements which provide an application
+ * with the ability to create and inject navigation events into the pipeline.
+ *
+ *
+ *
+ *
+ * GstNavigation event handling API. GstNavigation events are created in response to
+ * calls on a GstNavigation interface implementation, and sent in the pipeline. Upstream
+ * elements can use the navigation event API functions to parse the contents of received
+ * messages.
+ *
+ *
+ *
+ *
+ * GstNavigation message handling API. GstNavigation messages may be sent on the message
+ * bus to inform applications of navigation related changes in the pipeline, such as the
+ * mouse moving over a clickable region, or the set of available angles changing.
+ *
+ * The GstNavigation message functions provide functions for creating and parsing
+ * custom bus messages for signalling GstNavigation changes.
+ *
+ *
+ *
+ */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
+#include
static void gst_navigation_class_init (GstNavigationInterface * iface);
+
+#define GST_NAVIGATION_MESSAGE_NAME "GstNavigationMessage"
+#define GST_NAVIGATION_QUERY_NAME "GstNavigationQuery"
+#define GST_NAVIGATION_EVENT_NAME "application/x-gst-navigation"
+
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
GType
gst_navigation_get_type (void)
{
@@ -78,30 +123,807 @@
iface->send_event (navigation, structure);
}
}
+
+/**
+ * gst_navigation_send_mouse_event:
+ * @navigation: The navigation interface instance
+ * @event: The type of the key event. Recognised values are "key-press" and
+ * "key-release"
+ * @key: Character representation of the key. This is typically as produced
+ * by XKeysymToString.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_navigation_send_key_event (GstNavigation * navigation, const char *event,
const char *key)
{
gst_navigation_send_event (navigation,
- gst_structure_new ("application/x-gst-navigation", "event", G_TYPE_STRING,
+ gst_structure_new (GST_NAVIGATION_EVENT_NAME, "event", G_TYPE_STRING,
event, "key", G_TYPE_STRING, key, NULL));
}
+
+/**
+ * gst_navigation_send_mouse_event:
+ * @navigation: The navigation interface instance
+ * @event: The type of mouse event, as a text string. Recognised values are
+ * "mouse-button-press", "mouse-button-release" and "mouse-move".
+ * @button: The button number of the button being pressed or released. Pass 0
+ * for mouse-move events.
+ * @x: The x coordinate of the mouse event.
+ * @y: The y coordinate of the mouse event.
+ *
+ * Sends a mouse event to the navigation interface. Mouse event coordinates
+ * are sent relative to the display space of the related output area. This is
+ * usually the size in pixels of the window associated with the element
+ * implementing the #GstNavigation interface.
+ *
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_navigation_send_mouse_event (GstNavigation * navigation, const char *event,
int button, double x, double y)
{
gst_navigation_send_event (navigation,
- gst_structure_new ("application/x-gst-navigation", "event", G_TYPE_STRING,
+ gst_structure_new (GST_NAVIGATION_EVENT_NAME, "event", G_TYPE_STRING,
event, "button", G_TYPE_INT, button, "pointer_x", G_TYPE_DOUBLE, x,
"pointer_y", G_TYPE_DOUBLE, y, NULL));
}
+
+/**
+ * gst_navigation_send_command:
+ * @navigation: The navigation interface instance
+ * @command: The command to issue
+ *
+ * Sends the indicated command to the navigation interface.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_navigation_send_command (GstNavigation * navigation,
+ GstNavigationCommand command)
+{
+ gst_navigation_send_event (navigation,
+ gst_structure_new (GST_NAVIGATION_EVENT_NAME, "event", G_TYPE_STRING,
+ "command", "command-code", G_TYPE_UINT, (guint) command, NULL));
+}
+
+/* Navigation Queries */
+
+#define GST_NAVIGATION_QUERY_HAS_TYPE(query,query_type) \
+(gst_navigation_query_get_type (query) == GST_NAVIGATION_QUERY_ ## query_type)
+
+/**
+ * gst_navigation_query_get_type:
+ * @query: The query to inspect
+ *
+ * Inspect a #GstQuery and return the #GstNavigationQueryType associated with
+ * it if it is a #GstNavigation query.
+ *
+ * Returns: The #GstNavigationQueryType of the query, or
+ * #GST_NAVIGATION_QUERY_INVALID
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstNavigationQueryType
+gst_navigation_query_get_type (GstQuery * query)
+{
+ const GstStructure *s;
+ const gchar *q_type;
+
+ if (query == NULL || GST_QUERY_TYPE (query) != GST_QUERY_CUSTOM)
+ return GST_NAVIGATION_QUERY_INVALID;
+
+ s = gst_query_get_structure (query);
+ if (s == NULL || !gst_structure_has_name (s, GST_NAVIGATION_QUERY_NAME))
+ return GST_NAVIGATION_QUERY_INVALID;
+
+ q_type = gst_structure_get_string (s, "type");
+ if (q_type == NULL)
+ return GST_NAVIGATION_QUERY_INVALID;
+
+ if (g_str_equal (q_type, "commands"))
+ return GST_NAVIGATION_QUERY_COMMANDS;
+ else if (g_str_equal (q_type, "angles"))
+ return GST_NAVIGATION_QUERY_ANGLES;
+
+ return GST_NAVIGATION_QUERY_INVALID;
+}
+
+/**
+ * gst_navigation_query_new_commands:
+ *
+ * Create a new #GstNavigation commands query. When executed, it will
+ * query the pipeline for the set of currently available commands.
+ *
+ * Returns: The new query.
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstQuery *
+gst_navigation_query_new_commands (void)
+{
+ GstQuery *query;
+ GstStructure *structure;
+
+ structure = gst_structure_new (GST_NAVIGATION_QUERY_NAME,
+ "type", G_TYPE_STRING, "commands", NULL);
+ query = gst_query_new_application (GST_QUERY_CUSTOM, structure);
+
+ return query;
+}
+
+static void
+gst_query_list_add_command (GValue * list, GstNavigationCommand val)
+{
+ GValue item = { 0, };
+
+ g_value_init (&item, GST_TYPE_NAVIGATION_COMMAND);
+ g_value_set_enum (&item, val);
+ gst_value_list_append_value (list, &item);
+ g_value_unset (&item);
+}
+
+/**
+ * gst_navigation_query_set_commands:
+ * @query: a #GstQuery
+ * @n_cmds: the number of commands to set.
+ * @...: A list of @GstNavigationCommand values, @n_cmds entries long.
+ *
+ * Set the #GstNavigation command query result fields in @query. The number
+ * of commands passed must be equal to @n_commands.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_navigation_query_set_commands (GstQuery * query, gint n_cmds, ...)
+{
+ va_list ap;
+ GValue list = { 0, };
+ GstStructure *structure;
+ gint i;
+
+ g_return_if_fail (GST_NAVIGATION_QUERY_HAS_TYPE (query, COMMANDS));
+
+ g_value_init (&list, GST_TYPE_LIST);
+
+ va_start (ap, n_cmds);
+ for (i = 0; i < n_cmds; i++) {
+ GstNavigationCommand val = va_arg (ap, GstNavigationCommand);
+ gst_query_list_add_command (&list, val);
+ }
+ va_end (ap);
+
+ structure = gst_query_get_structure (query);
+ gst_structure_set_value (structure, "commands", &list);
+
+ g_value_unset (&list);
+}
+
+/**
+ * gst_navigation_query_set_commandsv:
+ * @query: a #GstQuery
+ * @n_cmds: the number of commands to set.
+ * @cmds: An array containing @n_cmds @GstNavigationCommand values.
+ *
+ * Set the #GstNavigation command query result fields in @query. The number
+ * of commands passed must be equal to @n_commands.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_navigation_query_set_commandsv (GstQuery * query, gint n_cmds,
+ GstNavigationCommand * cmds)
+{
+ GValue list = { 0, };
+ GstStructure *structure;
+ gint i;
+
+ g_return_if_fail (GST_NAVIGATION_QUERY_HAS_TYPE (query, COMMANDS));
+
+ g_value_init (&list, GST_TYPE_LIST);
+ for (i = 0; i < n_cmds; i++) {
+ gst_query_list_add_command (&list, cmds[i]);
+ }
+ structure = gst_query_get_structure (query);
+ gst_structure_set_value (structure, "commands", &list);
+
+ g_value_unset (&list);
+}
+
+/**
+ * gst_navigation_query_parse_commands_length:
+ * @query: a #GstQuery
+ * @n_cmds: the number of commands in this query.
+ *
+ * Parse the number of commands in the #GstNavigation commands @query.
+ *
+ * Returns: %TRUE if the query could be successfully parsed. %FALSE if not.
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_navigation_query_parse_commands_length (GstQuery * query, guint * n_cmds)
+{
+ GstStructure *structure;
+ const GValue *list;
+
+ g_return_val_if_fail (GST_NAVIGATION_QUERY_HAS_TYPE (query, COMMANDS), FALSE);
+
+ if (n_cmds == NULL)
+ return TRUE;
+
+ structure = gst_query_get_structure (query);
+ list = gst_structure_get_value (structure, "commands");
+ if (list == NULL)
+ *n_cmds = 0;
+ else
+ *n_cmds = gst_value_list_get_size (list);
+
+ return TRUE;
+}
+
+/**
+ * gst_navigation_query_parse_commands_nth:
+ * @query: a #GstQuery
+ * @nth: the nth command to retrieve.
+ * @cmd: a pointer to store the nth command into.
+ *
+ * Parse the #GstNavigation command query and retrieve the @nth command from
+ * it into @cmd. If the list contains less elements than @nth, @cmd will be
+ * set to #GST_NAVIGATION_COMMAND_INVALID.
+ *
+ * Returns: %TRUE if the query could be successfully parsed. %FALSE if not.
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_navigation_query_parse_commands_nth (GstQuery * query, guint nth,
+ GstNavigationCommand * cmd)
+{
+ GstStructure *structure;
+ const GValue *list;
+
+ g_return_val_if_fail (GST_NAVIGATION_QUERY_HAS_TYPE (query, COMMANDS), FALSE);
+
+ if (cmd == NULL)
+ return TRUE;
+
+ structure = gst_query_get_structure (query);
+ list = gst_structure_get_value (structure, "commands");
+ if (list == NULL) {
+ *cmd = GST_NAVIGATION_COMMAND_INVALID;
+ } else {
+ if (nth < gst_value_list_get_size (list)) {
+ *cmd = (GstNavigationCommand)
+ g_value_get_enum (gst_value_list_get_value (list, nth));
+ } else
+ *cmd = GST_NAVIGATION_COMMAND_INVALID;
+ }
+
+ return TRUE;
+}
+
+/**
+ * gst_navigation_query_new_angles:
+ *
+ * Create a new #GstNavigation angles query. When executed, it will
+ * query the pipeline for the set of currently available angles, which may be
+ * greater than one in a multiangle video.
+ *
+ * Returns: The new query.
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstQuery *
+gst_navigation_query_new_angles (void)
+{
+ GstQuery *query;
+ GstStructure *structure;
+
+ structure = gst_structure_new (GST_NAVIGATION_QUERY_NAME,
+ "type", G_TYPE_STRING, "angles", NULL);
+ query = gst_query_new_application (GST_QUERY_CUSTOM, structure);
+
+ return query;
+}
+
+/**
+ * gst_navigation_query_set_angles:
+ * @query: a #GstQuery
+ * @cur_angle: the current viewing angle to set.
+ * @n_angles: the number of viewing angles to set.
+ *
+ * Set the #GstNavigation angles query result field in @query.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_navigation_query_set_angles (GstQuery * query, guint cur_angle,
+ guint n_angles)
+{
+ GstStructure *structure;
+
+ g_return_if_fail (GST_NAVIGATION_QUERY_HAS_TYPE (query, ANGLES));
+
+ structure = gst_query_get_structure (query);
+ gst_structure_set (structure,
+ "angle", G_TYPE_UINT, cur_angle, "angles", G_TYPE_UINT, n_angles, NULL);
+}
+
+/**
+ * gst_navigation_query_parse_angles:
+ * @query: a #GstQuery
+ * @cur_angle: Pointer to a #guint into which to store the currently selected
+ * angle value from the query, or NULL
+ * @n_angles: Pointer to a #guint into which to store the number of angles
+ * value from the query, or NULL
+ *
+ * Parse the current angle number in the #GstNavigation angles @query into the
+ * #guint pointed to by the @cur_angle variable, and the number of available
+ * angles into the #guint pointed to by the @n_angles variable.
+ *
+ * Returns: %TRUE if the query could be successfully parsed. %FALSE if not.
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_navigation_query_parse_angles (GstQuery * query, guint * cur_angle,
+ guint * n_angles)
+{
+ GstStructure *structure;
+
+ g_return_val_if_fail (GST_NAVIGATION_QUERY_HAS_TYPE (query, ANGLES), FALSE);
+
+ structure = gst_query_get_structure (query);
+
+ if (cur_angle)
+ g_return_val_if_fail (gst_structure_get_uint (structure,
+ "angle", cur_angle), FALSE);
+
+ if (n_angles)
+ g_return_val_if_fail (gst_structure_get_uint (structure,
+ "angles", n_angles), FALSE);
+
+ return TRUE;
+}
+
+/* Navigation Messages */
+
+#define GST_NAVIGATION_MESSAGE_HAS_TYPE(msg,msg_type) \
+(gst_navigation_message_get_type (msg) == GST_NAVIGATION_MESSAGE_ ## msg_type)
+
+/**
+ * gst_navigation_message_get_type:
+ * @message: A #GstMessage to inspect.
+ *
+ * Check a bus message to see if it is a #GstNavigation event, and return
+ * the #GstNavigationMessageType identifying the type of the message if so.
+ *
+ * Returns: The type of the #GstNavigationMessage, or
+ * #GST_NAVIGATION_MESSAGE_INVALID if the message is not a #GstNavigation
+ * notification.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstNavigationMessageType
+gst_navigation_message_get_type (GstMessage * message)
+{
+ const GstStructure *s;
+ const gchar *m_type;
+
+ if (message == NULL || GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
+ return GST_NAVIGATION_MESSAGE_INVALID;
+
+ s = gst_message_get_structure (message);
+ if (s == NULL || !gst_structure_has_name (s, GST_NAVIGATION_MESSAGE_NAME))
+ return GST_NAVIGATION_MESSAGE_INVALID;
+
+ m_type = gst_structure_get_string (s, "type");
+ if (m_type == NULL)
+ return GST_NAVIGATION_MESSAGE_INVALID;
+
+ if (g_str_equal (m_type, "mouse-over"))
+ return GST_NAVIGATION_MESSAGE_MOUSE_OVER;
+ else if (g_str_equal (m_type, "commands-changed"))
+ return GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED;
+ else if (g_str_equal (m_type, "angles-changed"))
+ return GST_NAVIGATION_MESSAGE_ANGLES_CHANGED;
+
+ return GST_NAVIGATION_MESSAGE_INVALID;
+}
+
+/**
+ * gst_navigation_message_new_mouse_over:
+ * @src: A #GstObject to set as source of the new message.
+ * @active: %TRUE if the mouse has entered a clickable area of the display.
+ * %FALSE if it over a non-clickable area.
+ *
+ * Creates a new #GstNavigation message with type
+ * #GST_NAVIGATION_MESSAGE_MOUSE_OVER.
+ *
+ * Returns: The new #GstMessage.
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstMessage *
+gst_navigation_message_new_mouse_over (GstObject * src, gboolean active)
+{
+ GstStructure *s;
+ GstMessage *m;
+
+ s = gst_structure_new (GST_NAVIGATION_MESSAGE_NAME,
+ "type", G_TYPE_STRING, "mouse-over", "active", G_TYPE_BOOLEAN, active,
+ NULL);
+
+ m = gst_message_new_custom (GST_MESSAGE_ELEMENT, src, s);
+
+ return m;
+}
+
+/**
+ * gst_navigation_message_parse_mouse_over:
+ * @message: A #GstMessage to inspect.
+ * @active: A pointer to a gboolean to receive the active/inactive state,
+ * or NULL.
+ *
+ * Parse a #GstNavigation message of type #GST_NAVIGATION_MESSAGE_MOUSE_OVER
+ * and extract the active/inactive flag. If the mouse over event is marked
+ * active, it indicates that the mouse is over a clickable area.
+ *
+ * Returns: %TRUE if the message could be successfully parsed. %FALSE if not.
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_navigation_message_parse_mouse_over (GstMessage * message,
+ gboolean * active)
+{
+ if (!GST_NAVIGATION_MESSAGE_HAS_TYPE (message, MOUSE_OVER))
+ return FALSE;
+
+ if (active) {
+ const GstStructure *s = gst_message_get_structure (message);
+ if (gst_structure_get_boolean (s, "active", active) == FALSE)
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/**
+ * gst_navigation_message_new_commands_changed:
+ * @src: A #GstObject to set as source of the new message.
+ *
+ * Creates a new #GstNavigation message with type
+ * #GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED
+ *
+ * Returns: The new #GstMessage.
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstMessage *
+gst_navigation_message_new_commands_changed (GstObject * src)
+{
+ GstStructure *s;
+ GstMessage *m;
+
+ s = gst_structure_new (GST_NAVIGATION_MESSAGE_NAME,
+ "type", G_TYPE_STRING, "commands-changed", NULL);
+
+ m = gst_message_new_custom (GST_MESSAGE_ELEMENT, src, s);
+
+ return m;
+}
+
+/**
+ * gst_navigation_message_new_angles_changed:
+ * @src: A #GstObject to set as source of the new message.
+ * @cur_angle: The currently selected angle.
+ * @n_angles: The number of viewing angles now available.
+ *
+ * Creates a new #GstNavigation message with type
+ * #GST_NAVIGATION_MESSAGE_ANGLES_CHANGED for notifying an application
+ * that the current angle, or current number of angles available in a
+ * multiangle video has changed.
+ *
+ * Returns: The new #GstMessage.
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstMessage *
+gst_navigation_message_new_angles_changed (GstObject * src, guint cur_angle,
+ guint n_angles)
+{
+ GstStructure *s;
+ GstMessage *m;
+
+ s = gst_structure_new (GST_NAVIGATION_MESSAGE_NAME,
+ "type", G_TYPE_STRING, "angles-changed",
+ "angle", G_TYPE_UINT, cur_angle, "angles", G_TYPE_UINT, n_angles, NULL);
+
+ m = gst_message_new_custom (GST_MESSAGE_ELEMENT, src, s);
+
+ return m;
+}
+
+/**
+ * gst_navigation_message_parse_angles_changed:
+ * @message: A #GstMessage to inspect.
+ * @cur_angle: A pointer to a #guint to receive the new current angle number,
+ * or NULL
+ * @n_angles: A pointer to a #guint to receive the new angle count, or NULL.
+ *
+ * Parse a #GstNavigation message of type GST_NAVIGATION_MESSAGE_ANGLES_CHANGED
+ * and extract the @cur_angle and @n_angles parameters.
+ *
+ * Returns: %TRUE if the message could be successfully parsed. %FALSE if not.
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_navigation_message_parse_angles_changed (GstMessage * message,
+ guint * cur_angle, guint * n_angles)
+{
+ const GstStructure *s;
+
+ g_return_val_if_fail (GST_NAVIGATION_MESSAGE_HAS_TYPE (message,
+ ANGLES_CHANGED), FALSE);
+
+ s = gst_message_get_structure (message);
+ if (cur_angle)
+ g_return_val_if_fail (gst_structure_get_uint (s, "angle", cur_angle),
+ FALSE);
+
+ if (n_angles)
+ g_return_val_if_fail (gst_structure_get_uint (s, "angles", n_angles),
+ FALSE);
+
+ return TRUE;
+}
+
+#define GST_NAVIGATION_EVENT_HAS_TYPE(event,event_type) \
+(gst_navigation_event_get_type (event) == GST_NAVIGATION_EVENT_ ## event_type)
+
+/**
+ * gst_navigation_event_get_type:
+ * @event: A #GstEvent to inspect.
+ *
+ * Inspect a #GstEvent and return the #GstNavigationEventType of the event, or
+ * #GST_NAVIGATION_EVENT_INVALID if the event is not a #GstNavigation event.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstNavigationEventType
+gst_navigation_event_get_type (GstEvent * event)
+{
+ const GstStructure *s;
+ const gchar *e_type;
+
+ if (event == NULL || GST_EVENT_TYPE (event) != GST_EVENT_NAVIGATION)
+ return GST_NAVIGATION_EVENT_INVALID;
+
+ s = gst_event_get_structure (event);
+ if (s == NULL || !gst_structure_has_name (s, GST_NAVIGATION_EVENT_NAME))
+ return GST_NAVIGATION_EVENT_INVALID;
+
+ e_type = gst_structure_get_string (s, "event");
+ if (e_type == NULL)
+ return GST_NAVIGATION_EVENT_INVALID;
+
+ if (g_str_equal (e_type, "mouse-button-press"))
+ return GST_NAVIGATION_EVENT_MOUSE_BUTTON_PRESS;
+ else if (g_str_equal (e_type, "mouse-button-release"))
+ return GST_NAVIGATION_EVENT_MOUSE_BUTTON_RELEASE;
+ else if (g_str_equal (e_type, "mouse-move"))
+ return GST_NAVIGATION_EVENT_MOUSE_MOVE;
+ else if (g_str_equal (e_type, "key-press"))
+ return GST_NAVIGATION_EVENT_KEY_PRESS;
+ else if (g_str_equal (e_type, "key-release"))
+ return GST_NAVIGATION_EVENT_KEY_RELEASE;
+ else if (g_str_equal (e_type, "command"))
+ return GST_NAVIGATION_EVENT_COMMAND;
+
+ return GST_NAVIGATION_EVENT_INVALID;
+}
+
+/**
+ * gst_navigation_event_parse_key_event:
+ * @event: A #GstEvent to inspect.
+ * @key: A pointer to a location to receive the string identifying the key
+ * press. The returned string is owned by the event, and valid only until the
+ * event is unreffed.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_navigation_event_parse_key_event (GstEvent * event, const gchar ** key)
+{
+ GstNavigationEventType e_type;
+ const GstStructure *s;
+
+ e_type = gst_navigation_event_get_type (event);
+ g_return_val_if_fail (e_type == GST_NAVIGATION_EVENT_KEY_PRESS ||
+ e_type == GST_NAVIGATION_EVENT_KEY_RELEASE, FALSE);
+
+ if (key) {
+ s = gst_event_get_structure (event);
+ *key = gst_structure_get_string (s, "key");
+ if (*key == NULL)
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/**
+ * gst_navigation_event_parse_mouse_button_event:
+ * @event: A #GstEvent to inspect.
+ * @button: Pointer to a gint that will receive the button number associated
+ * with the event.
+ * @x: Pointer to a gdouble to receive the x coordinate of the mouse button
+ * event.
+ * @y: Pointer to a gdouble to receive the y coordinate of the mouse button
+ * event.
+ *
+ * Retrieve the details of either a #GstNavigation mouse button press event or
+ * a mouse button release event. Determine which type the event is using
+ * gst_navigation_event_get_type() to retrieve the #GstNavigationEventType.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_navigation_event_parse_mouse_button_event (GstEvent * event, gint * button,
+ gdouble * x, gdouble * y)
+{
+ GstNavigationEventType e_type;
+ const GstStructure *s;
+
+ e_type = gst_navigation_event_get_type (event);
+ g_return_val_if_fail (e_type == GST_NAVIGATION_EVENT_MOUSE_BUTTON_PRESS ||
+ e_type == GST_NAVIGATION_EVENT_MOUSE_BUTTON_RELEASE, FALSE);
+
+ s = gst_event_get_structure (event);
+ if (x)
+ g_return_val_if_fail (gst_structure_get_double (s, "pointer_x", x), FALSE);
+ if (y)
+ g_return_val_if_fail (gst_structure_get_double (s, "pointer_y", y), FALSE);
+ if (button)
+ g_return_val_if_fail (gst_structure_get_int (s, "button", button), FALSE);
+
+ return TRUE;
+}
+
+/**
+ * gst_navigation_event_parse_mouse_move_event:
+ * @event: A #GstEvent to inspect.
+ * @x: Pointer to a gdouble to receive the x coordinate of the mouse movement.
+ * @y: Pointer to a gdouble to receive the y coordinate of the mouse movement.
+ *
+ * Inspect a #GstNavigation mouse movement event and extract the coordinates
+ * of the event.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_navigation_event_parse_mouse_move_event (GstEvent * event, gdouble * x,
+ gdouble * y)
+{
+ const GstStructure *s;
+
+ g_return_val_if_fail (GST_NAVIGATION_EVENT_HAS_TYPE (event, MOUSE_MOVE),
+ FALSE);
+
+ s = gst_event_get_structure (event);
+ if (x)
+ g_return_val_if_fail (gst_structure_get_double (s, "pointer_x", x), FALSE);
+ if (y)
+ g_return_val_if_fail (gst_structure_get_double (s, "pointer_y", y), FALSE);
+
+ return TRUE;
+}
+
+/**
+ * gst_navigation_event_parse_command:
+ * @event: A #GstEvent to inspect.
+ * @command: Pointer to GstNavigationCommand to receive the type of the
+ * navigation event.
+ *
+ * Inspect a #GstNavigation command event and retrieve the enum value of the
+ * associated command.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_navigation_event_parse_command (GstEvent * event,
+ GstNavigationCommand * command)
+{
+ const GstStructure *s;
+ g_return_val_if_fail (GST_NAVIGATION_EVENT_HAS_TYPE (event, COMMAND), FALSE);
+
+ if (command) {
+ s = gst_event_get_structure (event);
+ g_return_val_if_fail (gst_structure_get_uint (s, "command-code", (guint*)command),
+ FALSE);
+ }
+
+ return TRUE;
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/navigation.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/navigation.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/navigation.h Wed Mar 24 18:04:17 2010 -0500
@@ -37,15 +37,16 @@
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_NAVIGATION, GstNavigationInterface))
typedef struct _GstNavigation GstNavigation;
+typedef struct _GstNavigationInterface GstNavigationInterface;
-typedef struct _GstNavigationInterface {
+struct _GstNavigationInterface {
GTypeInterface g_iface;
/* virtual functions */
void (*send_event) (GstNavigation *navigation, GstStructure *structure);
gpointer _gst_reserved[GST_PADDING];
-} GstNavigationInterface;
+};
#ifdef __SYMBIAN32__
IMPORT_C
#endif
@@ -53,16 +54,288 @@
GType gst_navigation_get_type (void);
-/* virtual class function wrappers */
+/* Navigation commands */
+
+/**
+ * GstNavigationCommand:
+ * @GST_NAVIGATION_COMMAND_INVALID: An invalid command entry
+ * @GST_NAVIGATION_COMMAND_MENU1: Execute navigation menu command 1. For DVD,
+ * this enters the DVD root menu, or exits back to the title from the menu.
+ * @GST_NAVIGATION_COMMAND_MENU2: Execute navigation menu command 2. For DVD,
+ * this jumps to the DVD title menu.
+ * @GST_NAVIGATION_COMMAND_MENU3: Execute navigation menu command 3. For DVD,
+ * this jumps into the DVD root menu.
+ * @GST_NAVIGATION_COMMAND_MENU4: Execute navigation menu command 4. For DVD,
+ * this jumps to the Subpicture menu.
+ * @GST_NAVIGATION_COMMAND_MENU5: Execute navigation menu command 5. For DVD,
+ * the jumps to the audio menu.
+ * @GST_NAVIGATION_COMMAND_MENU6: Execute navigation menu command 6. For DVD,
+ * this jumps to the angles menu.
+ * @GST_NAVIGATION_COMMAND_MENU7: Execute navigation menu command 7. For DVD,
+ * this jumps to the chapter menu.
+ * @GST_NAVIGATION_COMMAND_LEFT: Select the next button to the left in a menu,
+ * if such a button exists.
+ * @GST_NAVIGATION_COMMAND_RIGHT: Select the next button to the right in a menu,
+ * if such a button exists.
+ * @GST_NAVIGATION_COMMAND_UP: Select the button above the current one in a
+ * menu, if such a button exists.
+ * @GST_NAVIGATION_COMMAND_DOWN: Select the button below the current one in a
+ * menu, if such a button exists.
+ * @GST_NAVIGATION_COMMAND_ACTIVATE: Activate (click) the currently selected
+ * button in a menu, if such a button exists.
+ * @GST_NAVIGATION_COMMAND_PREV_ANGLE: Switch to the previous angle in a
+ * multiangle feature.
+ * @GST_NAVIGATION_COMMAND_NEXT_ANGLE: Switch to the next angle in a multiangle
+ * feature.
+ *
+ * A set of commands that may be issued to an element providing the
+ * #GstNavigation interface. The available commands can be queried via
+ * the gst_navigation_query_new_commands() query.
+ *
+ * For convenience in handling DVD navigation, the MENU commands are aliased as:
+ * GST_NAVIGATION_COMMAND_DVD_MENU = @GST_NAVIGATION_COMMAND_MENU1
+ * GST_NAVIGATION_COMMAND_DVD_TITLE_MENU = @GST_NAVIGATION_COMMAND_MENU2
+ * GST_NAVIGATION_COMMAND_DVD_ROOT_MENU = @GST_NAVIGATION_COMMAND_MENU3
+ * GST_NAVIGATION_COMMAND_DVD_SUBPICTURE_MENU = @GST_NAVIGATION_COMMAND_MENU4
+ * GST_NAVIGATION_COMMAND_DVD_AUDIO_MENU = @GST_NAVIGATION_COMMAND_MENU5
+ * GST_NAVIGATION_COMMAND_DVD_ANGLE_MENU = @GST_NAVIGATION_COMMAND_MENU6
+ * GST_NAVIGATION_COMMAND_DVD_CHAPTER_MENU = @GST_NAVIGATION_COMMAND_MENU7
+ *
+ * Since: 0.10.23
+ */
+typedef enum {
+ GST_NAVIGATION_COMMAND_INVALID = 0,
+
+ GST_NAVIGATION_COMMAND_MENU1 = 1,
+ GST_NAVIGATION_COMMAND_MENU2 = 2,
+ GST_NAVIGATION_COMMAND_MENU3 = 3,
+ GST_NAVIGATION_COMMAND_MENU4 = 4,
+ GST_NAVIGATION_COMMAND_MENU5 = 5,
+ GST_NAVIGATION_COMMAND_MENU6 = 6,
+ GST_NAVIGATION_COMMAND_MENU7 = 7,
+
+ GST_NAVIGATION_COMMAND_LEFT = 20,
+ GST_NAVIGATION_COMMAND_RIGHT = 21,
+ GST_NAVIGATION_COMMAND_UP = 22,
+ GST_NAVIGATION_COMMAND_DOWN = 23,
+ GST_NAVIGATION_COMMAND_ACTIVATE = 24,
+
+ GST_NAVIGATION_COMMAND_PREV_ANGLE = 30,
+ GST_NAVIGATION_COMMAND_NEXT_ANGLE = 31
+} GstNavigationCommand;
+
+/* Some aliases for the menu command types */
+#define GST_NAVIGATION_COMMAND_DVD_MENU GST_NAVIGATION_COMMAND_MENU1
+#define GST_NAVIGATION_COMMAND_DVD_TITLE_MENU GST_NAVIGATION_COMMAND_MENU2
+#define GST_NAVIGATION_COMMAND_DVD_ROOT_MENU GST_NAVIGATION_COMMAND_MENU3
+#define GST_NAVIGATION_COMMAND_DVD_SUBPICTURE_MENU GST_NAVIGATION_COMMAND_MENU4
+#define GST_NAVIGATION_COMMAND_DVD_AUDIO_MENU GST_NAVIGATION_COMMAND_MENU5
+#define GST_NAVIGATION_COMMAND_DVD_ANGLE_MENU GST_NAVIGATION_COMMAND_MENU6
+#define GST_NAVIGATION_COMMAND_DVD_CHAPTER_MENU GST_NAVIGATION_COMMAND_MENU7
+
+/* Queries */
+typedef enum
+{
+ GST_NAVIGATION_QUERY_INVALID = 0,
+ GST_NAVIGATION_QUERY_COMMANDS = 1,
+ GST_NAVIGATION_QUERY_ANGLES = 2
+} GstNavigationQueryType;
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GstNavigationQueryType gst_navigation_query_get_type (GstQuery *query);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GstQuery *gst_navigation_query_new_commands (void);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+void gst_navigation_query_set_commands (GstQuery *query, gint n_cmds, ...);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+void gst_navigation_query_set_commandsv (GstQuery *query, gint n_cmds,
+ GstNavigationCommand *cmds);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gboolean gst_navigation_query_parse_commands_length (GstQuery *query,
+ guint *n_cmds);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gboolean gst_navigation_query_parse_commands_nth (GstQuery *query, guint nth,
+ GstNavigationCommand *cmd);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GstQuery *gst_navigation_query_new_angles (void);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+void gst_navigation_query_set_angles (GstQuery *query, guint cur_angle,
+ guint n_angles);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
-void gst_navigation_send_event (GstNavigation *navigation, GstStructure *structure);
+gboolean gst_navigation_query_parse_angles (GstQuery *query, guint *cur_angle,
+ guint *n_angles);
+
+/* Element messages */
+/**
+ * GstNavigationMessageType:
+ * @GST_NAVIGATION_MESSAGE_INVALID: Returned from
+ * gst_navigation_message_get_type() when the passed message is not a
+ * navigation message.
+ * @GST_NAVIGATION_MESSAGE_MOUSE_OVER: Sent when the mouse moves over or leaves a
+ * clickable region of the output, such as a DVD menu button.
+ * @GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED: Sent when the set of available commands
+ * changes and should re-queried by interested applications.
+ * @GST_NAVIGATION_MESSAGE_ANGLES_CHANGED: Sent when display angles in a multi-angle
+ * feature (such as a multiangle DVD) change - either angles have appeared or
+ * disappeared.
+ *
+ * A set of notifications that may be received on the bus when navigation
+ * related status changes.
+ *
+ * Since: 0.10.23
+ */
+typedef enum {
+ GST_NAVIGATION_MESSAGE_INVALID,
+ GST_NAVIGATION_MESSAGE_MOUSE_OVER,
+ GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED,
+ GST_NAVIGATION_MESSAGE_ANGLES_CHANGED
+} GstNavigationMessageType;
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GstNavigationMessageType gst_navigation_message_get_type (GstMessage *message);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GstMessage *gst_navigation_message_new_mouse_over (GstObject *src,
+ gboolean active);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gboolean gst_navigation_message_parse_mouse_over (GstMessage *message,
+ gboolean *active);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GstMessage *gst_navigation_message_new_commands_changed (GstObject *src);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GstMessage *gst_navigation_message_new_angles_changed (GstObject *src,
+ guint cur_angle,
+ guint n_angles);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
+gboolean gst_navigation_message_parse_angles_changed (GstMessage *message,
+ guint *cur_angle,
+ guint *n_angles);
+
+/* event parsing functions */
+/**
+ * GstNavigationEventType:
+ * @GST_NAVIGATION_EVENT_INVALID: Returned from
+ * gst_navigation_event_get_type() when the passed event is not a navigation event.
+ * @GST_NAVIGATION_EVENT_KEY_PRESS: A key press event. Use
+ * gst_navigation_event_parse_key_event() to extract the details from the event.
+ * @GST_NAVIGATION_EVENT_KEY_RELEASE: A key release event. Use
+ * gst_navigation_event_parse_key_event() to extract the details from the event.
+ * @GST_NAVIGATION_EVENT_MOUSE_BUTTON_PRESS: A mouse button press event. Use
+ * gst_navigation_event_parse_mouse_button_event() to extract the details from the
+ * event.
+ * @GST_NAVIGATION_EVENT_MOUSE_BUTTON_RELEASE: A mouse button release event. Use
+ * gst_navigation_event_parse_mouse_button_event() to extract the details from the
+ * event.
+ * @GST_NAVIGATION_EVENT_MOUSE_MOVE: A mouse movement event. Use
+ * gst_navigation_event_parse_mouse_move_event() to extract the details from the
+ * event.
+ * @GST_NAVIGATION_EVENT_COMMAND: A navigation command event. Use
+ * gst_navigation_event_parse_command() to extract the details from the event.
+ *
+ * Enum values for the various events that an element implementing the
+ * GstNavigation interface might send up the pipeline.
+ *
+ * Since: 0.10.23
+ */
+typedef enum {
+ GST_NAVIGATION_EVENT_INVALID = 0,
+ GST_NAVIGATION_EVENT_KEY_PRESS = 1,
+ GST_NAVIGATION_EVENT_KEY_RELEASE = 2,
+ GST_NAVIGATION_EVENT_MOUSE_BUTTON_PRESS = 3,
+ GST_NAVIGATION_EVENT_MOUSE_BUTTON_RELEASE = 4,
+ GST_NAVIGATION_EVENT_MOUSE_MOVE = 5,
+ GST_NAVIGATION_EVENT_COMMAND = 6
+} GstNavigationEventType;
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GstNavigationEventType gst_navigation_event_get_type (GstEvent *event);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gboolean gst_navigation_event_parse_key_event (GstEvent *event,
+ const gchar **key);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gboolean gst_navigation_event_parse_mouse_button_event (GstEvent *event,
+ gint *button, gdouble *x, gdouble *y);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gboolean gst_navigation_event_parse_mouse_move_event (GstEvent *event,
+ gdouble *x, gdouble *y);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gboolean gst_navigation_event_parse_command (GstEvent *event,
+ GstNavigationCommand *command);
+
+/* interface virtual function wrappers */
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+void gst_navigation_send_event (GstNavigation *navigation,
+ GstStructure *structure);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
void gst_navigation_send_key_event (GstNavigation *navigation,
const char *event, const char *key);
@@ -72,6 +345,12 @@
void gst_navigation_send_mouse_event (GstNavigation *navigation,
const char *event, int button, double x, double y);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+void gst_navigation_send_command (GstNavigation *navigation,
+ GstNavigationCommand command);
G_END_DECLS
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/propertyprobe.c
--- a/gst_plugins_base/gst-libs/gst/interfaces/propertyprobe.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/propertyprobe.c Wed Mar 24 18:04:17 2010 -0500
@@ -18,7 +18,15 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-
+/**
+ * SECTION:gstpropertyprobe
+ * @short_description: Interface for probing possible property values
+ *
+ * The property probe is a way to autodetect allowed values for a GObject
+ * property. It's primary use is to autodetect device-names in several elements.
+ *
+ * The interface is implemented by many hardware sources and sinks.
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -73,6 +81,15 @@
static gboolean initialized = FALSE;
if (!initialized) {
+ /**
+ * GstPropertyProbe::probe-needed
+ * @pspec: #GParamSpec that needs a probe
+ *
+ */
+ /* FIXME:
+ * what is the purpose of this signal, I can't find any usage of it
+ * according to proto n *.h, it should be g_cclosure_marshal_VOID__PARAM
+ */
gst_property_probe_signals[SIGNAL_PROBE_NEEDED] =
g_signal_new ("probe-needed", G_TYPE_FROM_CLASS (iface),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstPropertyProbeInterface,
@@ -99,13 +116,13 @@
EXPORT_C
#endif
-
const GList *
gst_property_probe_get_properties (GstPropertyProbe * probe)
{
GstPropertyProbeInterface *iface;
g_return_val_if_fail (probe != NULL, NULL);
+ g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
iface = GST_PROPERTY_PROBE_GET_IFACE (probe);
@@ -114,35 +131,58 @@
return NULL;
}
+
+/**
+ * gst_property_probe_get_property:
+ * @probe: the #GstPropertyProbe to get the properties for.
+ * @name: name of the property.
+ *
+ * Get #GParamSpec for a property for which probing is supported.
+ *
+ * Returns: the #GParamSpec of %NULL.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
const GParamSpec *
gst_property_probe_get_property (GstPropertyProbe * probe, const gchar * name)
{
- const GList *pspecs = gst_property_probe_get_properties (probe);
+ const GList *pspecs;
g_return_val_if_fail (probe != NULL, NULL);
+ g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
g_return_val_if_fail (name != NULL, NULL);
+ pspecs = gst_property_probe_get_properties (probe);
+
while (pspecs) {
const GParamSpec *pspec = pspecs->data;
- if (!strcmp (pspec->name, name))
- return pspec;
+ if (pspec) {
+ if (!strcmp (pspec->name, name))
+ return pspec;
+ } else {
+ GST_WARNING_OBJECT (probe, "NULL paramspec in property probe list");
+ }
pspecs = pspecs->next;
}
return NULL;
}
+
+/**
+ * gst_property_probe_probe_property:
+ * @probe: the #GstPropertyProbe to check.
+ * @pspec: #GParamSpec of the property.
+ *
+ * Runs a probe on the property specified by %pspec
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_property_probe_probe_property (GstPropertyProbe * probe,
const GParamSpec * pspec)
@@ -150,6 +190,7 @@
GstPropertyProbeInterface *iface;
g_return_if_fail (probe != NULL);
+ g_return_if_fail (GST_IS_PROPERTY_PROBE (probe));
g_return_if_fail (pspec != NULL);
iface = GST_PROPERTY_PROBE_GET_IFACE (probe);
@@ -161,15 +202,14 @@
/**
* gst_property_probe_probe_property_name:
* @probe: the #GstPropertyProbe to check.
- * @name: name of the property to return.
+ * @name: name of the property.
*
- * Runs a probe on the given property.
+ * Runs a probe on the property specified by %name.
*/
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_property_probe_probe_property_name (GstPropertyProbe * probe,
const gchar * name)
@@ -177,6 +217,7 @@
const GParamSpec *pspec;
g_return_if_fail (probe != NULL);
+ g_return_if_fail (GST_IS_PROPERTY_PROBE (probe));
g_return_if_fail (name != NULL);
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (probe), name);
@@ -205,7 +246,6 @@
EXPORT_C
#endif
-
gboolean
gst_property_probe_needs_probe (GstPropertyProbe * probe,
const GParamSpec * pspec)
@@ -213,6 +253,7 @@
GstPropertyProbeInterface *iface;
g_return_val_if_fail (probe != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), FALSE);
g_return_val_if_fail (pspec != NULL, FALSE);
iface = GST_PROPERTY_PROBE_GET_IFACE (probe);
@@ -236,7 +277,6 @@
EXPORT_C
#endif
-
gboolean
gst_property_probe_needs_probe_name (GstPropertyProbe * probe,
const gchar * name)
@@ -244,6 +284,7 @@
const GParamSpec *pspec;
g_return_val_if_fail (probe != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), FALSE);
g_return_val_if_fail (name != NULL, FALSE);
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (probe), name);
@@ -269,7 +310,6 @@
EXPORT_C
#endif
-
GValueArray *
gst_property_probe_get_values (GstPropertyProbe * probe,
const GParamSpec * pspec)
@@ -277,6 +317,7 @@
GstPropertyProbeInterface *iface;
g_return_val_if_fail (probe != NULL, NULL);
+ g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
g_return_val_if_fail (pspec != NULL, NULL);
iface = GST_PROPERTY_PROBE_GET_IFACE (probe);
@@ -300,7 +341,6 @@
EXPORT_C
#endif
-
GValueArray *
gst_property_probe_get_values_name (GstPropertyProbe * probe,
const gchar * name)
@@ -308,6 +348,7 @@
const GParamSpec *pspec;
g_return_val_if_fail (probe != NULL, NULL);
+ g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
g_return_val_if_fail (name != NULL, NULL);
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (probe), name);
@@ -334,7 +375,6 @@
EXPORT_C
#endif
-
GValueArray *
gst_property_probe_probe_and_get_values (GstPropertyProbe * probe,
const GParamSpec * pspec)
@@ -342,6 +382,7 @@
GstPropertyProbeInterface *iface;
g_return_val_if_fail (probe != NULL, NULL);
+ g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
g_return_val_if_fail (pspec != NULL, NULL);
iface = GST_PROPERTY_PROBE_GET_IFACE (probe);
@@ -365,7 +406,6 @@
EXPORT_C
#endif
-
GValueArray *
gst_property_probe_probe_and_get_values_name (GstPropertyProbe * probe,
const gchar * name)
@@ -373,6 +413,7 @@
const GParamSpec *pspec;
g_return_val_if_fail (probe != NULL, NULL);
+ g_return_val_if_fail (GST_IS_PROPERTY_PROBE (probe), NULL);
g_return_val_if_fail (name != NULL, NULL);
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (probe), name);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/propertyprobe.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/propertyprobe.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/propertyprobe.h Wed Mar 24 18:04:17 2010 -0500
@@ -35,9 +35,26 @@
#define GST_PROPERTY_PROBE_GET_IFACE(obj) \
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_PROPERTY_PROBE, GstPropertyProbeInterface))
+/**
+ * GstPropertyProbe:
+ *
+ * Opaque #GstPropertyProbe data structure.
+ */
typedef struct _GstPropertyProbe GstPropertyProbe; /* dummy typedef */
+typedef struct _GstPropertyProbeInterface GstPropertyProbeInterface;
-typedef struct _GstPropertyProbeInterface {
+/**
+ * GstPropertyProbeInterface:
+ * @klass: parent interface type.
+ * @probe_needed: default signal handler
+ * @get_properties: virtual method to get list of probable properties
+ * @needs_probe: virtual method to tell if probe need update
+ * @probe_property: virtual method to probe a property
+ * @get_values: virtual method to get probe results for a property
+ *
+ * #GstPropertyProbe interface.
+ */
+struct _GstPropertyProbeInterface {
GTypeInterface klass;
/* signals */
@@ -56,8 +73,9 @@
guint prop_id,
const GParamSpec *pspec);
+ /*< private >*/
gpointer _gst_reserved[GST_PADDING];
-} GstPropertyProbeInterface;
+};
#ifdef __SYMBIAN32__
IMPORT_C
#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/tuner.c
--- a/gst_plugins_base/gst-libs/gst/interfaces/tuner.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/tuner.c Wed Mar 24 18:04:17 2010 -0500
@@ -31,6 +31,46 @@
/**
* SECTION:gsttuner
* @short_description: Interface for elements providing tuner operations
+ *
+ *
+ *
+ * The GstTuner interface is provided by elements that have the ability to
+ * tune into multiple input signals, for example TV or radio capture cards.
+ *
+ * The interpretation of 'tuning into' an input stream depends on the element
+ * implementing the interface. For v4lsrc, it might imply selection of an
+ * input source and/or frequency to be configured on a TV card. Another
+ * GstTuner implementation might be to allow selection of an active input pad
+ * from multiple input pads.
+ *
+ * That said, the GstTuner interface functions are biased toward the
+ * TV capture scenario.
+ *
+ * The general parameters provided are for configuration are:
+ *
+ * Selection of a current #GstTunerChannel. The current channel
+ * represents the input source (e.g. Composite, S-Video etc for TV capture).
+ *
+ * The #GstTunerNorm for the channel. The norm chooses the
+ * interpretation of the incoming signal for the current channel. For example,
+ * PAL or NTSC, or more specific variants there-of.
+ *
+ * Channel frequency. If the current channel has the ability to tune
+ * between multiple frequencies (if it has the GST_TUNER_CHANNEL_FREQUENCY flag)
+ * then the frequency can be changed/
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+retrieved via the
+ * gst_tuner_set_frequency() and gst_tuner_get_frequency() methods.
+ *
+ *
+ *
+ *
+ * Where applicable, the signal strength can be retrieved and/or monitored
+ * via a signal.
+ *
+ *
*/
enum
@@ -83,12 +123,26 @@
static gboolean initialized = FALSE;
if (!initialized) {
+ /**
+ * GstTuner::norm-changed:
+ * @tuner: The element providing the GstTuner interface
+ * @norm: The new configured norm.
+ *
+ * Reports that the current #GstTunerNorm has changed.
+ */
gst_tuner_signals[NORM_CHANGED] =
g_signal_new ("norm-changed",
GST_TYPE_TUNER, G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstTunerClass, norm_changed),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GST_TYPE_TUNER_NORM);
+ /**
+ * GstTuner::channel-changed:
+ * @tuner: The element providing the GstTuner interface
+ * @channel: The new configured channel.
+ *
+ * Reports that the current #GstTunerChannel has changed.
+ */
gst_tuner_signals[CHANNEL_CHANGED] =
g_signal_new ("channel-changed",
GST_TYPE_TUNER, G_SIGNAL_RUN_LAST,
@@ -96,6 +150,13 @@
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
GST_TYPE_TUNER_CHANNEL);
+ /**
+ * GstTuner::frequency-changed:
+ * @tuner: The element providing the GstTuner interface
+ * @frequency: The new frequency (an unsigned long)
+ *
+ * Reports that the current frequency has changed.
+ */
gst_tuner_signals[FREQUENCY_CHANGED] =
g_signal_new ("frequency-changed",
GST_TYPE_TUNER, G_SIGNAL_RUN_LAST,
@@ -103,6 +164,16 @@
NULL, NULL,
gst_interfaces_marshal_VOID__OBJECT_ULONG, G_TYPE_NONE, 2,
GST_TYPE_TUNER_CHANNEL, G_TYPE_ULONG);
+ /**
+ * GstTuner::signal-changed:
+ * @tuner: The element providing the GstTuner interface
+ * @channel: The current #GstTunerChannel
+ * @signal: The new signal strength (an integer)
+ *
+ * Reports that the signal strength has changed.
+ *
+ * See Also: gst_tuner_signal_strength()
+ */
gst_tuner_signals[SIGNAL_CHANGED] =
g_signal_new ("signal-changed",
GST_TYPE_TUNER, G_SIGNAL_RUN_LAST,
@@ -132,16 +203,16 @@
* gst_tuner_list_channels:
* @tuner: the #GstTuner (a #GstElement) to get the channels from.
*
- * Retrieve a list of channels (e.g. 'composite', 's-video', ...)
- * from the given tuner object.
+ * Retrieve a #GList of #GstTunerChannels available
+ * (e.g. 'composite', 's-video', ...) from the given tuner object.
*
- * Returns: a list of channels available on this tuner.
+ * Returns: A list of channels available on this tuner. The list is
+ * owned by the GstTuner and must not be freed.
*/
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
const GList *
gst_tuner_list_channels (GstTuner * tuner)
{
@@ -183,7 +254,7 @@
}
/**
- * gst_Tuner_get_channel:
+ * gst_tuner_get_channel:
* @tuner: the #GstTuner (a #GstElement) to get the current channel from.
*
* Retrieve the current channel from the tuner.
@@ -211,14 +282,15 @@
}
/**
- * gst_tuner_get_norms_list:
+ * gst_tuner_list_norms:
* @tuner: the #GstTuner (*a #GstElement) to get the list of norms from.
*
- * Retrieve a list of available norms on the currently tuned channel
- * from the given tuner object.
+ * Retrieve a GList of available #GstTunerNorm settings for the currently
+ * tuned channel on the given tuner object.
*
* Returns: A list of norms available on the current channel for this
- * tuner object.
+ * tuner object. The list is owned by the GstTuner and must not
+ * be freed.
*/
#ifdef __SYMBIAN32__
EXPORT_C
@@ -296,20 +368,24 @@
/**
* gst_tuner_set_frequency:
- * @tuner: the #Gsttuner (a #GstElement) that owns the given channel.
- * @channel: the #GstTunerChannel to set the frequency on.
- * @frequency: the frequency to tune in to.
+ * @tuner: The #Gsttuner (a #GstElement) that owns the given channel.
+ * @channel: The #GstTunerChannel to set the frequency on.
+ * @frequency: The frequency to tune in to.
*
* Sets a tuning frequency on the given tuner/channel. Note that this
* requires the given channel to be a "tuning" channel, which can be
* checked using GST_TUNER_CHANNEL_HAS_FLAG (), with the proper flag
* being GST_TUNER_CHANNEL_FREQUENCY.
+ *
+ * The frequency is in Hz, with minimum steps indicated by the
+ * frequency_multiplicator provided in the #GstTunerChannel. The
+ * valid range is provided in the min_frequency and max_frequency properties
+ * of the #GstTunerChannel.
*/
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_tuner_set_frequency (GstTuner * tuner,
GstTunerChannel * channel, gulong frequency)
@@ -329,13 +405,14 @@
/**
* gst_tuner_get_frequency:
- * @tuner: the #GstTuner (a #GstElement) that owns the given channel.
- * @channel: the #GstTunerChannel to retrieve the frequency from.
+ * @tuner: The #GstTuner (a #GstElement) that owns the given channel.
+ * @channel: The #GstTunerChannel to retrieve the frequency from.
*
- * Retrieve the current frequency from the given channel. The same
- * applies as for set_frequency (): check the flag.
+ * Retrieve the current frequency from the given channel. As for
+ * gst_tuner_set_frequency(), the #GstTunerChannel must support frequency
+ * operations, as indicated by the GST_TUNER_CHANNEL_FREQUENCY flag.
*
- * Returns: the current frequency, or 0 on error.
+ * Returns: The current frequency, or 0 on error.
*/
#ifdef __SYMBIAN32__
EXPORT_C
@@ -362,23 +439,25 @@
}
/**
- * gst_tuner_get_signal_strength:
+ * gst_tuner_signal_strength:
* @tuner: the #GstTuner (a #GstElement) that owns the given channel.
* @channel: the #GstTunerChannel to get the signal strength from.
*
- * get the strength of the signal on this channel. Note that this
- * requires the current channel to be a "tuning" channel, e.g. a
+ * Get the strength of the signal on this channel. Note that this
+ * requires the current channel to be a "tuning" channel, i.e. a
* channel on which frequency can be set. This can be checked using
* GST_TUNER_CHANNEL_HAS_FLAG (), and the appropriate flag to check
* for is GST_TUNER_CHANNEL_FREQUENCY.
*
- * Returns: signal strength, or 0 on error.
+ * The valid range of the signal strength is indicated in the
+ * min_signal and max_signal properties of the #GstTunerChannel.
+ *
+ * Returns: Signal strength, or 0 on error.
*/
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
gint
gst_tuner_signal_strength (GstTuner * tuner, GstTunerChannel * channel)
{
@@ -396,11 +475,21 @@
return 0;
}
+
+/**
+ * gst_tuner_find_norm_by_name:
+ * @tuner: A #GstTuner instance
+ * @norm: A string containing the name of a #GstTunerNorm
+ *
+ * Look up a #GstTunerNorm by name.
+ *
+ * Returns: A #GstTunerNorm, or NULL if no norm with the provided name
+ * is available.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
GstTunerNorm *
gst_tuner_find_norm_by_name (GstTuner * tuner, gchar * norm)
{
@@ -417,11 +506,21 @@
}
return NULL;
}
+
+/**
+ * gst_tuner_find_channel_by_name:
+ * @tuner: A #GstTuner instance
+ * @channel: A string containing the name of a #GstTunerChannel
+ *
+ * Look up a #GstTunerChannel by name.
+ *
+ * Returns: A #GstTunerChannel, or NULL if no channel with the provided name
+ * is available.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
GstTunerChannel *
gst_tuner_find_channel_by_name (GstTuner * tuner, gchar * channel)
{
@@ -438,11 +537,19 @@
}
return NULL;
}
+
+/**
+ * gst_tuner_channel_changed:
+ * @tuner: A #GstTuner instance
+ * @channel: A #GstTunerChannel instance
+ *
+ * Called by elements implementing the #GstTuner interface when the
+ * current channel changes. Fires the #GstTuner::channel-changed signal.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_tuner_channel_changed (GstTuner * tuner, GstTunerChannel * channel)
{
@@ -452,11 +559,20 @@
g_signal_emit (G_OBJECT (tuner),
gst_tuner_signals[CHANNEL_CHANGED], 0, channel);
}
+
+/**
+ * gst_tuner_norm_changed:
+ * @tuner: A #GstTuner instance
+ * @norm: A #GstTunerNorm instance
+ *
+ * Called by elements implementing the #GstTuner interface when the
+ * current norm changes. Fires the #GstTuner::norm-changed signal.
+ *
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_tuner_norm_changed (GstTuner * tuner, GstTunerNorm * norm)
{
@@ -465,11 +581,22 @@
g_signal_emit (G_OBJECT (tuner), gst_tuner_signals[NORM_CHANGED], 0, norm);
}
+
+/**
+ * gst_tuner_frequency_changed:
+ * @tuner: A #GstTuner instance
+ * @channel: The current #GstTunerChannel
+ * @frequency: The new frequency setting
+ *
+ * Called by elements implementing the #GstTuner interface when the
+ * configured frequency changes. Fires the #GstTuner::frequency-changed
+ * signal on the tuner, and the #GstTunerChannel::frequency-changed signal
+ * on the channel.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_tuner_frequency_changed (GstTuner * tuner,
GstTunerChannel * channel, gulong frequency)
@@ -482,11 +609,22 @@
g_signal_emit_by_name (G_OBJECT (channel), "frequency_changed", frequency);
}
+
+/**
+ * gst_tuner_signal_changed:
+ * @tuner: A #GstTuner instance
+ * @channel: The current #GstTunerChannel
+ * @signal: The new signal strength
+ *
+ * Called by elements implementing the #GstTuner interface when the
+ * incoming signal strength changes. Fires the #GstTuner::signal-changed
+ * signal on the tuner and the #GstTunerChannel::signal-changed signal on
+ * the channel.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_tuner_signal_changed (GstTuner * tuner,
GstTunerChannel * channel, gint signal)
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/tuner.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/tuner.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/tuner.h Wed Mar 24 18:04:17 2010 -0500
@@ -43,8 +43,9 @@
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_TUNER, GstTunerClass))
typedef struct _GstTuner GstTuner;
+typedef struct _GstTunerClass GstTunerClass;
-typedef struct _GstTunerClass {
+struct _GstTunerClass {
GTypeInterface klass;
/* virtual functions */
@@ -80,7 +81,7 @@
gint signal);
gpointer _gst_reserved[GST_PADDING];
-} GstTunerClass;
+};
#ifdef __SYMBIAN32__
IMPORT_C
#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/tunerchannel.c
--- a/gst_plugins_base/gst-libs/gst/interfaces/tunerchannel.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/tunerchannel.c Wed Mar 24 18:04:17 2010 -0500
@@ -25,6 +25,24 @@
#include "tunerchannel.h"
+/**
+ * SECTION:gsttunerchannel
+ * @short_description: A channel from an element implementing the #GstTuner
+ * interface.
+ *
+ *
+ * The #GstTunerChannel object is provided by an element implementing
+ * the #GstTuner interface.
+ *
+ *
+ * GstTunerChannel provides a name and flags to determine the type and
+ * capabilities of the channel. If the GST_TUNER_CHANNEL_FREQUENCY flag is
+ * set, then the channel also information about the minimum and maximum
+ * frequency, and range of the reported signal strength.
+ *
+ *
+ */
+
enum
{
/* FILL ME */
@@ -78,12 +96,28 @@
parent_class = g_type_class_peek_parent (klass);
+ /**
+ * GstTunerChannel::frequency-changed:
+ * @tunerchannel: The #GstTunerChannel
+ * @frequency: The new frequency (an unsigned long)
+ *
+ * Reports that the current frequency has changed.
+ */
signals[SIGNAL_FREQUENCY_CHANGED] =
g_signal_new ("frequency-changed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstTunerChannelClass,
frequency_changed),
NULL, NULL, g_cclosure_marshal_VOID__ULONG, G_TYPE_NONE, 1, G_TYPE_ULONG);
+ /**
+ * GstTunerChannel::signal-changed:
+ * @tunerchannel: The #GstTunerChannel
+ * @signal: The new signal strength (an integer)
+ *
+ * Reports that the signal strength has changed.
+ *
+ * See Also: gst_tuner_signal_strength()
+ */
signals[SIGNAL_SIGNAL_CHANGED] =
g_signal_new ("signal-changed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/tunerchannel.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/tunerchannel.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/tunerchannel.h Wed Mar 24 18:04:17 2010 -0500
@@ -39,6 +39,20 @@
#define GST_IS_TUNER_CHANNEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER_CHANNEL))
+typedef struct _GstTunerChannel GstTunerChannel;
+typedef struct _GstTunerChannelClass GstTunerChannelClass;
+
+/**
+ * GstTunerChannelFlags:
+ * @GST_TUNER_CHANNEL_INPUT: The channel is for input
+ * @GST_TUNER_CHANNEL_OUTPUT: The channel is for output
+ * @GST_TUNER_CHANNEL_FREQUENCY: The channel has a frequency setting
+ * and signal strength.
+ * @GST_TUNER_CHANNEL_AUDIO: The channel carries audio.
+ *
+ * An enumeration for flags indicating the available capabilities
+ * of a #GstTunerChannel.
+ */
typedef enum {
GST_TUNER_CHANNEL_INPUT = (1<<0),
GST_TUNER_CHANNEL_OUTPUT = (1<<1),
@@ -46,24 +60,43 @@
GST_TUNER_CHANNEL_AUDIO = (1<<3)
} GstTunerChannelFlags;
+/**
+ * GST_TUNER_CHANNEL_HAS_FLAG:
+ * @channel: A #GstTunerChannel
+ * @flag: The flag to check for
+ *
+ * Macro to check if the given flag is set on a channel
+ */
#define GST_TUNER_CHANNEL_HAS_FLAG(channel, flag) \
((channel)->flags & flag)
-typedef struct _GstTunerChannel {
+/**
+ * GstTunerChannel:
+ * @label: A string containing a descriptive name for this channel
+ * @flags: A set of #GstTunerChannelFlags for this channel
+ * @freq_multiplicator: The step size (in Hz) for the frequency setting.
+ * @min_frequency: Minimum valid frequency setting (in Hz).
+ * @max_frequency: Maximum valid frequency setting (in Hz).
+ * @min_signal: Minimum reported signal strength value.
+ * @max_signal: Maximum reported signal strength value.
+ */
+struct _GstTunerChannel {
GObject parent;
+ /*< public >*/
gchar *label;
GstTunerChannelFlags flags;
gfloat freq_multiplicator;
- gulong min_frequency,
- max_frequency;
- gint min_signal,
- max_signal;
-} GstTunerChannel;
+ gulong min_frequency;
+ gulong max_frequency;
+ gint min_signal;
+ gint max_signal;
+};
-typedef struct _GstTunerChannelClass {
+struct _GstTunerChannelClass {
GObjectClass parent;
+ /*< private >*/
/* signals */
void (*frequency_changed) (GstTunerChannel *channel,
gulong frequency);
@@ -71,7 +104,7 @@
gint signal);
gpointer _gst_reserved[GST_PADDING];
-} GstTunerChannelClass;
+};
#ifdef __SYMBIAN32__
IMPORT_C
#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/tunernorm.c
--- a/gst_plugins_base/gst-libs/gst/interfaces/tunernorm.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/tunernorm.c Wed Mar 24 18:04:17 2010 -0500
@@ -25,6 +25,19 @@
#include "tunernorm.h"
+/**
+ * SECTION:gsttunernorm
+ * @short_description: Encapsulates information about the data format(s)
+ * for a #GstTunerChannel.
+ *
+ *
+ * The #GstTunerNorm object is created by an element implementing the
+ * #GstTuner interface and encapsulates the selection of a capture/output format
+ * for a selected #GstTunerChannel.
+ *
+ *
+ */
+
enum
{
/* FILL ME */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/tunernorm.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/tunernorm.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/tunernorm.h Wed Mar 24 18:04:17 2010 -0500
@@ -37,18 +37,28 @@
#define GST_IS_TUNER_NORM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER_NORM))
-typedef struct _GstTunerNorm {
+typedef struct _GstTunerNorm GstTunerNorm;
+typedef struct _GstTunerNormClass GstTunerNormClass;
+
+/**
+ * GstTunerNorm:
+ * @label: A string containing a descriptive name for the norm
+ * @framerate: A GValue containing the framerate associated with this norm,
+ * if any. (May be unset).
+ */
+struct _GstTunerNorm {
GObject parent;
+ /*< public >*/
gchar *label;
GValue framerate;
-} GstTunerNorm;
+};
-typedef struct _GstTunerNormClass {
+struct _GstTunerNormClass {
GObjectClass parent;
gpointer _gst_reserved[GST_PADDING];
-} GstTunerNormClass;
+};
#ifdef __SYMBIAN32__
IMPORT_C
#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/videoorientation.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/videoorientation.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/videoorientation.h Wed Mar 24 18:04:17 2010 -0500
@@ -42,6 +42,7 @@
* Opaque #GstVideoOrientation data structure.
*/
typedef struct _GstVideoOrientation GstVideoOrientation;
+typedef struct _GstVideoOrientationInterface GstVideoOrientationInterface;
/**
* GstVideoOrientationInterface:
@@ -57,7 +58,7 @@
*
* #GstVideoOrientationInterface interface.
*/
-typedef struct _GstVideoOrientationInterface {
+struct _GstVideoOrientationInterface {
GTypeInterface parent;
/* virtual functions */
@@ -73,7 +74,7 @@
/*< private > */
gpointer _gst_reserved[GST_PADDING];
-} GstVideoOrientationInterface;
+};
#ifdef __SYMBIAN32__
IMPORT_C
#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/interfaces/xoverlay.h
--- a/gst_plugins_base/gst-libs/gst/interfaces/xoverlay.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/interfaces/xoverlay.h Wed Mar 24 18:04:17 2010 -0500
@@ -41,9 +41,24 @@
#define GST_X_OVERLAY_GET_CLASS(inst) \
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_X_OVERLAY, GstXOverlayClass))
+/**
+ * GstXOverlay:
+ *
+ * Opaque #GstXOverlay data structure.
+ */
typedef struct _GstXOverlay GstXOverlay;
+typedef struct _GstXOverlayClass GstXOverlayClass;
-typedef struct _GstXOverlayClass {
+/**
+ * GstXOverlayClass:
+ * @klass: parent interface type.
+ * @set_xwindow_id: virtual method to configure the XWindow id
+ * @expose: virtual method to handle expose events
+ * @handle_events: virtual method to handle events
+ *
+ * #GstXOverlay interface
+ */
+struct _GstXOverlayClass {
GTypeInterface klass;
/* virtual functions */
@@ -57,7 +72,7 @@
/*< private >*/
gpointer _gst_reserved[GST_PADDING - 1];
-} GstXOverlayClass;
+};
#ifdef __SYMBIAN32__
IMPORT_C
#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/netbuffer/README
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/netbuffer/README Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,9 @@
+The network libraries
+---------------------
+
+GstNetBuffer:
+
+ A GstBuffer subclass that can be used by network sources or sinks to
+ store additional to and from addresses. This is required for plugins
+ that operate on this data like RTP.
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/netbuffer/gstnetbuffer.c
--- a/gst_plugins_base/gst-libs/gst/netbuffer/gstnetbuffer.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/netbuffer/gstnetbuffer.c Wed Mar 24 18:04:17 2010 -0500
@@ -145,6 +145,9 @@
* @port: a port number to set.
*
* Set @naddr with the IPv4 @address and @port pair.
+ *
+ * Note that @port and @address must be expressed in network byte order,
+ * use g_htons() and g_htonl() to convert them to network byte order.
*/
#ifdef __SYMBIAN32__
EXPORT_C
@@ -168,6 +171,9 @@
* @port: a port number to set.
*
* Set @naddr with the IPv6 @address and @port pair.
+ *
+ * Note that @port must be expressed in network byte order, use g_htons() to convert
+ * it to network byte order.
*/
#ifdef __SYMBIAN32__
EXPORT_C
@@ -197,7 +203,7 @@
#endif
GstNetType
-gst_netaddress_get_net_type (GstNetAddress * naddr)
+gst_netaddress_get_net_type (const GstNetAddress * naddr)
{
g_return_val_if_fail (naddr != NULL, GST_NET_TYPE_UNKNOWN);
@@ -210,7 +216,11 @@
* @address: a location to store the address.
* @port: a location to store the port.
*
- * Get the IPv4 address stored in @naddr into @address.
+ * Get the IPv4 address stored in @naddr into @address. This function requires
+ * that the address type of @naddr is of type #GST_NET_TYPE_IP4.
+ *
+ * Note that @port and @address are expressed in network byte order, use
+ * g_ntohs() and g_ntohl() to convert them to host order.
*
* Returns: TRUE if the address could be retrieved.
*/
@@ -219,12 +229,12 @@
#endif
gboolean
-gst_netaddress_get_ip4_address (GstNetAddress * naddr, guint32 * address,
+gst_netaddress_get_ip4_address (const GstNetAddress * naddr, guint32 * address,
guint16 * port)
{
g_return_val_if_fail (naddr != NULL, FALSE);
- if (naddr->type == GST_NET_TYPE_UNKNOWN)
+ if (naddr->type == GST_NET_TYPE_UNKNOWN || naddr->type == GST_NET_TYPE_IP6)
return FALSE;
if (address)
@@ -243,6 +253,12 @@
*
* Get the IPv6 address stored in @naddr into @address.
*
+ * If @naddr is of type GST_NET_TYPE_IP4, the transitional IP6 address is
+ * returned.
+ *
+ * Note that @port is expressed in network byte order, use g_ntohs() to convert
+ * it to host order.
+ *
* Returns: TRUE if the address could be retrieved.
*/
#ifdef __SYMBIAN32__
@@ -250,16 +266,24 @@
#endif
gboolean
-gst_netaddress_get_ip6_address (GstNetAddress * naddr, guint8 address[16],
+gst_netaddress_get_ip6_address (const GstNetAddress * naddr, guint8 address[16],
guint16 * port)
{
+ static guint8 ip4_transition[16] =
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF };
g_return_val_if_fail (naddr != NULL, FALSE);
if (naddr->type == GST_NET_TYPE_UNKNOWN)
return FALSE;
- if (address)
- memcpy (address, naddr->address.ip6, 16);
+ if (address) {
+ if (naddr->type == GST_NET_TYPE_IP6) {
+ memcpy (address, naddr->address.ip6, 16);
+ } else { /* naddr->type == GST_NET_TYPE_IP4 */
+ memcpy (address, ip4_transition, 12);
+ memcpy (address + 12, (guint8 *) & (naddr->address.ip4), 4);
+ }
+ }
if (port)
*port = naddr->port;
@@ -267,6 +291,98 @@
}
/**
+ * gst_netaddress_get_address_bytes:
+ * @naddr: a network address
+ * @address: a location to store the result.
+ * @port: a location to store the port.
+ *
+ * Get just the address bytes stored in @naddr into @address.
+ *
+ * Note that @port is expressed in network byte order, use g_ntohs() to convert
+ * it to host order. IP4 addresses are also stored in network byte order.
+ *
+ * Returns: number of bytes actually copied
+ *
+ * Since: 0.10.22
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gint
+gst_netaddress_get_address_bytes (const GstNetAddress * naddr,
+ guint8 address[16], guint16 * port)
+{
+ gint ret = 0;
+
+ g_return_val_if_fail (naddr != NULL, FALSE);
+
+ if (naddr->type == GST_NET_TYPE_UNKNOWN)
+ return 0;
+
+ if (address) {
+ if (naddr->type == GST_NET_TYPE_IP6) {
+ memcpy (address, naddr->address.ip6, 16);
+ ret = 16;
+ } else { /* naddr->type == GST_NET_TYPE_IP4 */
+ memcpy (address, (guint8 *) & (naddr->address.ip4), 4);
+ ret = 4;
+ }
+ }
+ if (port)
+ *port = naddr->port;
+
+ return ret;
+}
+
+/**
+ * gst_netaddress_set_address_bytes:
+ * @naddr: a network address
+ * @address: a location to store the result.
+ * @port: a location to store the port.
+ *
+ * Set just the address bytes stored in @naddr into @address.
+ *
+ * Note that @port must be expressed in network byte order, use g_htons() to convert
+ * it to network byte order order. IP4 address bytes must also be stored in
+ * network byte order.
+ *
+ * Returns: number of bytes actually copied
+ *
+ * Since: 0.10.22
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gint
+gst_netaddress_set_address_bytes (GstNetAddress * naddr, GstNetType type,
+ guint8 address[16], guint16 port)
+{
+ gint len = 0;
+
+ g_return_val_if_fail (naddr != NULL, 0);
+
+ naddr->type = type;
+ switch (naddr->type) {
+ case GST_NET_TYPE_UNKNOWN:
+ case GST_NET_TYPE_IP6:
+ len = 16;
+ memcpy (naddr->address.ip6, address, 16);
+ break;
+ case GST_NET_TYPE_IP4:
+ len = 4;
+ memcpy ((guint8 *) & (naddr->address.ip4), address, 4);
+ break;
+ }
+
+ if (port)
+ naddr->port = port;
+
+ return len;
+}
+
+/**
* gst_netaddress_equal:
* @naddr1: The first #GstNetAddress
* @naddr2: The second #GstNetAddress
@@ -309,3 +425,68 @@
}
return TRUE;
}
+
+/**
+ * gst_netaddress_to_string:
+ * @naddr: a #GstNetAddress
+ * @dest: destination
+ * @len: len of @dest
+ *
+ * Copies a string representation of @naddr into @dest. Up to @len bytes are
+ * copied.
+ *
+ * Returns: the number of bytes which would be produced if the buffer was large
+ * enough
+ *
+ * Since: 0.10.24
+ */
+
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gint
+gst_netaddress_to_string (const GstNetAddress * naddr, gchar * dest, gulong len)
+{
+ gint result;
+
+ g_return_val_if_fail (naddr != NULL, FALSE);
+ g_return_val_if_fail (dest != NULL, FALSE);
+
+ switch (naddr->type) {
+ case GST_NET_TYPE_IP4:
+ {
+ guint32 address;
+ guint16 port;
+
+ gst_netaddress_get_ip4_address (naddr, &address, &port);
+ address = g_ntohl (address);
+
+ result = g_snprintf (dest, len, "%d.%d.%d.%d:%d", (address >> 24) & 0xff,
+ (address >> 16) & 0xff, (address >> 8) & 0xff, address & 0xff,
+ g_ntohs (port));
+ break;
+ }
+ case GST_NET_TYPE_IP6:
+ {
+ guint8 address[16];
+ guint16 port;
+
+ gst_netaddress_get_ip6_address (naddr, address, &port);
+
+ result =
+ g_snprintf (dest, len, "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]:%d",
+ (address[0] << 8) | address[1], (address[2] << 8) | address[3],
+ (address[4] << 8) | address[5], (address[6] << 8) | address[7],
+ (address[8] << 8) | address[9], (address[10] << 8) | address[11],
+ (address[12] << 8) | address[13], (address[14] << 8) | address[15],
+ g_ntohs (port));
+ break;
+ }
+ default:
+ dest[0] = 0;
+ result = 0;
+ break;
+ }
+ return result;
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/netbuffer/gstnetbuffer.h
--- a/gst_plugins_base/gst-libs/gst/netbuffer/gstnetbuffer.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/netbuffer/gstnetbuffer.h Wed Mar 24 18:04:17 2010 -0500
@@ -50,6 +50,16 @@
} GstNetType;
/**
+ * GST_NETADDRESS_MAX_LEN:
+ *
+ * The maximum length of a string representation of a GstNetAddress as produced
+ * by gst_netaddress_to_string().
+ *
+ * Since: 0.10.24
+ */
+#define GST_NETADDRESS_MAX_LEN 64
+
+/**
* GstNetAddress:
*
* An opaque network address as used in #GstNetBuffer.
@@ -97,48 +107,64 @@
IMPORT_C
#endif
-GType gst_netbuffer_get_type (void);
+GType gst_netbuffer_get_type (void);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
-GstNetBuffer* gst_netbuffer_new (void);
+GstNetBuffer* gst_netbuffer_new (void);
/* address operations */
#ifdef __SYMBIAN32__
IMPORT_C
#endif
-void gst_netaddress_set_ip4_address (GstNetAddress *naddr, guint32 address, guint16 port);
+void gst_netaddress_set_ip4_address (GstNetAddress *naddr, guint32 address, guint16 port);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
-void gst_netaddress_set_ip6_address (GstNetAddress *naddr, guint8 address[16], guint16 port);
+void gst_netaddress_set_ip6_address (GstNetAddress *naddr, guint8 address[16], guint16 port);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gint gst_netaddress_set_address_bytes (GstNetAddress *naddr, GstNetType type,
+ guint8 address[16], guint16 port);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
-GstNetType gst_netaddress_get_net_type (GstNetAddress *naddr);
+GstNetType gst_netaddress_get_net_type (const GstNetAddress *naddr);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
-gboolean gst_netaddress_get_ip4_address (GstNetAddress *naddr, guint32 *address, guint16 *port);
+gboolean gst_netaddress_get_ip4_address (const GstNetAddress *naddr, guint32 *address, guint16 *port);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
-gboolean gst_netaddress_get_ip6_address (GstNetAddress *naddr, guint8 address[16], guint16 *port);
+gboolean gst_netaddress_get_ip6_address (const GstNetAddress *naddr, guint8 address[16], guint16 *port);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+gint gst_netaddress_get_address_bytes (const GstNetAddress *naddr, guint8 address[16], guint16 *port);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
-gboolean gst_netaddress_equal (const GstNetAddress *naddr1,
- const GstNetAddress *naddr2);
+gboolean gst_netaddress_equal (const GstNetAddress *naddr1,
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+ const GstNetAddress *naddr2);
+
+gint gst_netaddress_to_string (const GstNetAddress *naddr, gchar *dest, gulong len);
G_END_DECLS
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/pbutils/descriptions.c
--- a/gst_plugins_base/gst-libs/gst/pbutils/descriptions.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/pbutils/descriptions.c Wed Mar 24 18:04:17 2010 -0500
@@ -30,11 +30,7 @@
*
*
* gst_pb_utils_add_codec_description_to_tag_list() is a utility function
- * for demuxer and decoder elements to add audio/
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-video codec tags from a
+ * for demuxer and decoder elements to add audio/video codec tags from a
* given (fixed) #GstCaps.
*
*
@@ -73,7 +69,10 @@
{"application/vnd.rn-realmedia", "Realmedia", FLAG_CONTAINER},
{"application/x-id3", N_("ID3 tag"), FLAG_CONTAINER},
{"application/x-ape", N_("APE tag"), FLAG_CONTAINER},
+ {"application/x-apetag", N_("APE tag"), FLAG_CONTAINER},
{"application/x-icy", N_("ICY internet radio"), FLAG_CONTAINER},
+ {"application/x-3gp", "3GP", FLAG_CONTAINER},
+ {"multipart/x-mixed-replace", "Multipart", FLAG_CONTAINER},
{"video/x-fli", "FLI/FLC/FLX Animation", FLAG_CONTAINER},
{"video/x-flv", "Flash", FLAG_CONTAINER},
{"video/x-matroska", "Matroska", FLAG_CONTAINER},
@@ -81,6 +80,7 @@
{"video/x-msvideo", "AVI", FLAG_CONTAINER},
{"video/x-quicktime", "Quicktime", FLAG_CONTAINER},
{"video/quicktime", "Quicktime", FLAG_CONTAINER},
+ {"video/mj2", "Motion JPEG 2000", FLAG_CONTAINER},
/* audio formats with static descriptions */
{"audio/x-ac3", "AC-3 (ATSC A/52)", 0},
@@ -120,12 +120,14 @@
{"audio/x-nist", "Sphere NIST", 0},
{"audio/x-nsf", "Nintendo NSF", 0},
{"audio/x-paris", "Ensoniq PARIS", 0},
+ {"audio/x-qdm", "QDesign Music (QDM)", 0},
{"audio/x-qdm2", "QDesign Music (QDM) 2", 0},
{"audio/x-ralf-mpeg4-generic", "Real Audio Lossless (RALF)", 0},
{"audio/x-sds", "SDS", 0},
{"audio/x-shorten", "Shorten Lossless", 0},
{"audio/x-sid", "Sid", 0},
{"audio/x-sipro", "Sipro/ACELP.NET Voice", 0},
+ {"audio/x-siren", "Siren", 0},
{"audio/x-spc", "SNES-SPC700 Sound File Data", 0},
{"audio/x-speex", "Speex", 0},
{"audio/x-svx", "Amiga IFF / SVX8 / SV16", 0},
@@ -157,7 +159,7 @@
{"video/x-dvd-subpicture", "DVD subpicture", 0},
{"video/x-ffv", N_("FFMpeg v1"), 0},
{"video/x-flash-screen", "Flash Screen Video", 0},
- {"video/x-flash-video", "Flash Video", 0},
+ {"video/x-flash-video", "Sorenson Spark Video", 0},
{"video/x-h261", "H.261", 0},
{"video/x-huffyuv", "Huffyuv", 0},
{"video/x-intel-h263", "Intel H.263", 0},
@@ -204,6 +206,9 @@
{"image/tiff", "TIFF", 0},
{"image/x-cmu-raster", "CMU Raster Format", 0},
{"image/x-icon", "ICO", 0},
+ {"image/x-j2c", "JPEG 2000", 0},
+ {"image/x-jpc", "JPEG 2000", 0},
+ {"image/jp2", "JPEG 2000", 0},
{"image/x-xcf", "XFC", 0},
{"image/x-pixmap", "XPM", 0},
{"image/x-xpixmap", "XPM", 0},
@@ -214,8 +219,14 @@
/* subtitle formats with static descriptions */
{"application/x-subtitle-sami", N_("Sami subtitle format"), 0},
{"application/x-subtitle-tmplayer", N_("TMPlayer subtitle format"), 0},
+ {"application/x-kate", "Kate", 0},
+ {"subtitle/x-kate", N_("Kate subtitle format"), 0},
/* add variant field to typefinder? { "application/x-subtitle", N_("subtitle"), 0}, */
+ /* non-audio/video/container formats */
+ {"hdv/aux-v", "HDV AUX-V", 0},
+ {"hdv/aux-a", "HDV AUX-A", 0},
+
/* formats with dynamic descriptions */
{"audio/mpeg", NULL, 0},
{"audio/x-adpcm", NULL, 0},
@@ -355,6 +366,8 @@
ret = "ITU H.264";
else if (strcmp (variant, "videosoft") == 0)
ret = "Videosoft H.264";
+ else if (strcmp (variant, "lead") == 0)
+ ret = "Lead H.264";
else {
GST_WARNING ("Unknown H264 variant '%s'", variant);
ret = "H.264";
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/pbutils/install-plugins.c
--- a/gst_plugins_base/gst-libs/gst/pbutils/install-plugins.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/pbutils/install-plugins.c Wed Mar 24 18:04:17 2010 -0500
@@ -144,7 +144,7 @@
* as interlocutor to the real installer though, even more so if command line
* argument munging is required to transform the command line arguments
* passed by GStreamer to the helper application into arguments that are
- * understood by the reeal installer.
+ * understood by the real installer.
*
*
* The helper application path defined at compile time can be overriden at
@@ -370,6 +370,8 @@
#include
#endif
+#include
+
/* best effort to make things compile and possibly even work on win32 */
#ifndef WEXITSTATUS
# define WEXITSTATUS(status) ((((guint)(status)) & 0xff00) >> 8)
@@ -393,8 +395,9 @@
*
* This function is for X11-based applications (such as most Gtk/Qt
* applications on linux/unix) only. You can use it to tell the external
- * the XID of your main application window, so the installer can make its
- * own window transient to your application windonw during the installation.
+ * installer the XID of your main application window. That way the installer
+ * can make its own window transient to your application window during the
+ * installation.
*
* If set, the XID will be passed to the installer via a --transient-for=XID
* command line option.
@@ -509,6 +512,18 @@
}
static gboolean
+ptr_array_contains_string (GPtrArray * arr, const gchar * s)
+{
+ gint i;
+
+ for (i = 0; i < arr->len; ++i) {
+ if (strcmp ((const char *) g_ptr_array_index (arr, i), s) == 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static gboolean
gst_install_plugins_spawn_child (gchar ** details,
GstInstallPluginsContext * ctx, GPid * child_pid, gint * exit_status)
{
@@ -528,9 +543,10 @@
g_ptr_array_add (arr, xid_str);
}
- /* finally, add the detail strings */
+ /* finally, add the detail strings, but without duplicates */
while (details != NULL && details[0] != NULL) {
- g_ptr_array_add (arr, details[0]);
+ if (!ptr_array_contains_string (arr, details[0]))
+ g_ptr_array_add (arr, details[0]);
++details;
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/pbutils/missing-plugins.c
--- a/gst_plugins_base/gst-libs/gst/pbutils/missing-plugins.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/pbutils/missing-plugins.c Wed Mar 24 18:04:17 2010 -0500
@@ -64,10 +64,6 @@
# include /* getpid on win32 */
#endif
-#ifdef __SYMBIAN32__
-#include
-#endif
-
#include "gst/gst-i18n-plugin.h"
#include "pbutils.h"
@@ -134,10 +130,13 @@
gst_structure_remove_field (s, "framerate");
gst_structure_remove_field (s, "leaf_size");
gst_structure_remove_field (s, "packet_size");
+ gst_structure_remove_field (s, "block_align");
+ gst_structure_remove_field (s, "metadata-interval"); /* icy caps */
/* decoders/encoders almost always handle the usual width/height/channel/rate
* range (and if we don't remove this then the app will have a much harder
* time blacklisting formats it has unsuccessfully tried to install before) */
gst_structure_remove_field (s, "width");
+ gst_structure_remove_field (s, "depth");
gst_structure_remove_field (s, "height");
gst_structure_remove_field (s, "channels");
gst_structure_remove_field (s, "rate");
@@ -151,6 +150,7 @@
gst_structure_remove_field (s, "npt-stop");
gst_structure_remove_field (s, "play-speed");
gst_structure_remove_field (s, "play-scale");
+ gst_structure_remove_field (s, "dynamic_range");
return ret;
}
@@ -518,6 +518,7 @@
#ifdef __SYMBIAN32__
EXPORT_C
#endif
+
gchar *
gst_missing_plugin_message_get_description (GstMessage * msg)
{
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/pbutils/pbutils-enumtypes.c
--- a/gst_plugins_base/gst-libs/gst/pbutils/pbutils-enumtypes.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/pbutils/pbutils-enumtypes.c Wed Mar 24 18:04:17 2010 -0500
@@ -1,12 +1,6 @@
/* Generated data (by glib-mkenums) */
-
-#ifdef __SYMBIAN32__
-#include
-#endif
-
-
#include "pbutils-enumtypes.h"
#include "pbutils.h"
@@ -22,8 +16,8 @@
GType
gst_install_plugins_return_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
static const GEnumValue values[] = {
{ GST_INSTALL_PLUGINS_SUCCESS, "GST_INSTALL_PLUGINS_SUCCESS", "success" },
{ GST_INSTALL_PLUGINS_NOT_FOUND, "GST_INSTALL_PLUGINS_NOT_FOUND", "not-found" },
@@ -38,9 +32,10 @@
{ GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS, "GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS", "install-in-progress" },
{ 0, NULL, NULL }
};
- etype = g_enum_register_static ("GstInstallPluginsReturn", values);
+ GType g_define_type_id = g_enum_register_static ("GstInstallPluginsReturn", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
- return etype;
+ return g_define_type_id__volatile;
}
/* Generated data ends here */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/pbutils/pbutils.c
--- a/gst_plugins_base/gst-libs/gst/pbutils/pbutils.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/pbutils/pbutils.c Wed Mar 24 18:04:17 2010 -0500
@@ -72,10 +72,6 @@
# include "config.h"
#endif
-#ifdef __SYMBIAN32__
-#include
-#endif
-
#include "pbutils.h"
#include "gst/gst-i18n-plugin.h"
@@ -109,6 +105,7 @@
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
inited = TRUE;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/riff/riff-ids.h
--- a/gst_plugins_base/gst-libs/gst/riff/riff-ids.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/riff/riff-ids.h Wed Mar 24 18:04:17 2010 -0500
@@ -52,6 +52,7 @@
#define GST_RIFF_TAG_bext GST_MAKE_FOURCC ('b','e','x','t')
#define GST_RIFF_TAG_BEXT GST_MAKE_FOURCC ('B','E','X','T')
#define GST_RIFF_TAG_fact GST_MAKE_FOURCC ('f','a','c','t')
+#define GST_RIFF_TAG_acid GST_MAKE_FOURCC ('a','c','i','d')
/* LIST types */
#define GST_RIFF_LIST_movi GST_MAKE_FOURCC ('m','o','v','i')
@@ -134,6 +135,8 @@
#define GST_RIFF_WHAM GST_MAKE_FOURCC ('W', 'H', 'A', 'M')
#define GST_RIFF_rgb GST_MAKE_FOURCC (0x00,0x00,0x00,0x00)
#define GST_RIFF_RGB GST_MAKE_FOURCC ('R', 'G', 'B', ' ')
+#define GST_RIFF_RAW GST_MAKE_FOURCC ('R', 'A', 'W', ' ')
+#define GST_RIFF_DIB GST_MAKE_FOURCC ('D', 'I', 'B', ' ')
#define GST_RIFF_rle8 GST_MAKE_FOURCC (0x01,0x00,0x00,0x00)
#define GST_RIFF_RLE8 GST_MAKE_FOURCC ('R', 'L', 'E', '8')
#define GST_RIFF_rle4 GST_MAKE_FOURCC (0x02,0x00,0x00,0x00)
@@ -323,15 +326,26 @@
#define GST_RIFF_WAVE_FORMAT_RT24 (0x0052)
#define GST_RIFF_WAVE_FORMAT_PAC (0x0053)
#define GST_RIFF_WAVE_FORMAT_MPEGL3 (0x0055)
+#define GST_RIFF_WAVE_FORMAT_AMR_NB (0x0057)
+#define GST_RIFF_WAVE_FORMAT_AMR_WB (0x0058)
#define GST_RIFF_WAVE_FORMAT_LUCENT_G723 (0x0059)
#define GST_RIFF_WAVE_FORMAT_CIRRUS (0x0060)
+#define GST_RIFF_WAVE_FORMAT_ADPCM_IMA_DK4 (0x0061) /* not official */
+#define GST_RIFF_WAVE_FORMAT_ADPCM_IMA_DK3 (0x0062) /* not official */
+/* FIXME: where are these from? are they used at all? */
+#if 0
#define GST_RIFF_WAVE_FORMAT_ESPCM (0x0061)
#define GST_RIFF_WAVE_FORMAT_VOXWARE (0x0062)
+#endif
#define GST_RIFF_WAVE_FORMAT_CANOPUS_ATRAC (0x0063)
#define GST_RIFF_WAVE_FORMAT_G726_ADPCM (0x0064)
#define GST_RIFF_WAVE_FORMAT_G722_ADPCM (0x0065)
#define GST_RIFF_WAVE_FORMAT_DSAT_DISPLAY (0x0067)
+#define GST_RIFF_WAVE_FORMAT_ADPCM_IMA_WAV (0x0069)
+/* FIXME: where are these from? are they used at all? */
+#if 0
#define GST_RIFF_WAVE_FORMAT_VOXWARE_BYTE_ALIGNED (0x0069)
+#endif
#define GST_RIFF_WAVE_FORMAT_VOXWARE_AC8 (0x0070)
#define GST_RIFF_WAVE_FORMAT_VOXWARE_AC10 (0x0071)
#define GST_RIFF_WAVE_FORMAT_VOXWARE_AC16 (0x0072)
@@ -393,8 +407,10 @@
#define GST_RIFF_WAVE_FORMAT_IPI_RPELP (0x0251)
#define GST_RIFF_WAVE_FORMAT_CS2 (0x0260)
#define GST_RIFF_WAVE_FORMAT_SONY_ATRAC3 (0x0270)
+#define GST_RIFF_WAVE_FORMAT_SIREN (0x028E)
#define GST_RIFF_WAVE_FORMAT_FM_TOWNS_SND (0x0300)
#define GST_RIFF_WAVE_FORMAT_BTV_DIGITAL (0x0400)
+#define GST_RIFF_WAVE_FORMAT_IMC (0x0401)
#define GST_RIFF_WAVE_FORMAT_QDESIGN_MUSIC (0x0450)
#define GST_RIFF_WAVE_FORMAT_VME_VMPCM (0x0680)
#define GST_RIFF_WAVE_FORMAT_TPC (0x0681)
@@ -408,14 +424,19 @@
#define GST_RIFF_WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS (0x1500)
#define GST_RIFF_WAVE_FORMAT_A52 (0x2000)
#define GST_RIFF_WAVE_FORMAT_DTS (0x2001)
+#define GST_RIFF_WAVE_FORMAT_SONIC (0x2048)
+#define GST_RIFF_WAVE_FORMAT_SONIC_LS (0x2048)
+#define GST_RIFF_WAVE_FORMAT_AAC_AC (0x4143)
#define GST_RIFF_WAVE_FORMAT_VORBIS1 (0x674f)
#define GST_RIFF_WAVE_FORMAT_VORBIS2 (0x6750)
#define GST_RIFF_WAVE_FORMAT_VORBIS3 (0x6751)
#define GST_RIFF_WAVE_FORMAT_VORBIS1PLUS (0x676f)
#define GST_RIFF_WAVE_FORMAT_VORBIS2PLUS (0x6770)
#define GST_RIFF_WAVE_FORMAT_VORBIS3PLUS (0x6771)
+#define GST_RIFF_WAVE_FORMAT_AAC_pm (0x706d)
#define GST_RIFF_WAVE_FORMAT_GSM_AMR_CBR (0x7A21)
#define GST_RIFF_WAVE_FORMAT_GSM_AMR_VBR (0x7A22)
+#define GST_RIFF_WAVE_FORMAT_FLAC (0xF1AC)
#define GST_RIFF_WAVE_FORMAT_EXTENSIBLE (0xFFFE)
guint16 channels;
guint32 rate;
@@ -450,6 +471,41 @@
guint32 totalframes;
} gst_riff_dmlh;
+/* taken from libsndfile/wav.c (LGPL) */
+typedef struct _gst_riff_acid {
+ /* 4 bytes (int) type of file:
+ * this appears to be a bit mask,however some combinations
+ * are probably impossible and/or qualified as "errors"
+ *
+ * 0x01 On: One Shot Off: Loop
+ * 0x02 On: Root note is Set Off: No root
+ * 0x04 On: Stretch is On, Off: Strech is OFF
+ * 0x08 On: Disk Based Off: Ram based
+ * 0x10 On: ?????????? Off: ????????? (Acidizer puts that ON)
+ */
+ guint32 loop_type;
+ /* 2 bytes (short) root note
+ * if type 0x10 is OFF : [C,C#,(...),B] -> [0x30 to 0x3B]
+ * if type 0x10 is ON : [C,C#,(...),B] -> [0x3C to 0x47]
+ * (both types fit on same MIDI pitch albeit different octaves, so who cares)
+ */
+ guint16 root_note;
+ /* 2 bytes (short) ??? always set to 0x8000
+ * 4 bytes (float) ??? seems to be always 0
+ */
+ guint16 unknown1;
+ gfloat unknown2;
+ /* 4 bytes (int) number of beats
+ * 2 bytes (short) meter denominator //always 4 in SF/ACID
+ * 2 bytes (short) meter numerator //always 4 in SF/ACID
+ * //are we sure about the order?? usually its num/denom
+ * 4 bytes (float) tempo
+ */
+ guint32 number_of_beats;
+ guint16 meter_d, meter_n;
+ gfloat tempo;
+} gst_riff_acid;
+
G_END_DECLS
#endif /* __GST_RIFF_IDS_H__ */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/riff/riff-media.c
--- a/gst_plugins_base/gst-libs/gst/riff/riff-media.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/riff/riff-media.c Wed Mar 24 18:04:17 2010 -0500
@@ -35,7 +35,7 @@
#define GST_CAT_DEFAULT riff_debug
/**
- * gst_riff_create_video_caps_with_data:
+ * gst_riff_create_video_caps:
* @codec_fcc: fourCC codec for this codec.
* @strh: pointer to the strh stream header structure.
* @strf: pointer to the strf stream header structure, including any
@@ -63,7 +63,11 @@
GST_DEBUG ("video fourcc %" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (codec_fcc));
switch (codec_fcc) {
- case GST_MAKE_FOURCC ('D', 'I', 'B', ' '):{
+ case GST_MAKE_FOURCC ('D', 'I', 'B', ' '): /* uncompressed RGB */
+ case GST_MAKE_FOURCC (0x00, 0x00, 0x00, 0x00):
+ case GST_MAKE_FOURCC ('R', 'G', 'B', ' '):
+ case GST_MAKE_FOURCC ('R', 'A', 'W', ' '):
+ {
gint bpp = (strf && strf->bit_cnt != 0) ? strf->bit_cnt : 8;
if (strf) {
@@ -79,6 +83,7 @@
"blue_mask", G_TYPE_INT, 0xff0000, NULL);
} else {
GST_WARNING ("Unhandled DIB RGB depth: %d", bpp);
+ return NULL;
}
} else {
/* for template */
@@ -113,11 +118,20 @@
*codec_name = g_strdup ("Uncompressed packed YVU 4:1:0");
break;
+ case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
+ caps = gst_caps_new_simple ("video/x-raw-yuv",
+ "format", GST_TYPE_FOURCC, codec_fcc, NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Uncompressed packed YUV 4:2:2");
+ break;
+
case GST_MAKE_FOURCC ('M', 'J', 'P', 'G'): /* YUY2 MJPEG */
case GST_MAKE_FOURCC ('A', 'V', 'R', 'n'):
case GST_MAKE_FOURCC ('I', 'J', 'P', 'G'):
case GST_MAKE_FOURCC ('i', 'j', 'p', 'g'):
- case GST_MAKE_FOURCC ('J', 'P', 'G', 'L'):
+ case GST_MAKE_FOURCC ('d', 'm', 'b', '1'):
+ case GST_MAKE_FOURCC ('A', 'C', 'D', 'V'):
+ case GST_MAKE_FOURCC ('Q', 'I', 'V', 'G'):
caps = gst_caps_new_simple ("image/jpeg", NULL);
if (codec_name)
*codec_name = g_strdup ("Motion JPEG");
@@ -134,7 +148,25 @@
case GST_MAKE_FOURCC ('V', 'I', 'X', 'L'): /* Miro/Pinnacle fourccs */
caps = gst_caps_new_simple ("image/jpeg", NULL);
if (codec_name)
- *codec_name = g_strdup ("Miro/Pinnacle Motion JPEG Video");
+ *codec_name = g_strdup ("Miro/Pinnacle Motion JPEG");
+ break;
+
+ case GST_MAKE_FOURCC ('C', 'J', 'P', 'G'):
+ caps = gst_caps_new_simple ("image/jpeg", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Creative Webcam JPEG");
+ break;
+
+ case GST_MAKE_FOURCC ('S', 'L', 'M', 'J'):
+ caps = gst_caps_new_simple ("image/jpeg", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("SL Motion JPEG");
+ break;
+
+ case GST_MAKE_FOURCC ('J', 'P', 'G', 'L'):
+ caps = gst_caps_new_simple ("image/jpeg", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Pegasus Lossless JPEG");
break;
case GST_MAKE_FOURCC ('S', 'P', '5', '3'):
@@ -163,14 +195,19 @@
case GST_MAKE_FOURCC ('m', 'p', 'g', '1'):
case GST_MAKE_FOURCC ('M', 'P', 'G', '1'):
case GST_MAKE_FOURCC ('P', 'I', 'M', '1'):
+ case GST_MAKE_FOURCC (0x01, 0x00, 0x00, 0x10):
caps = gst_caps_new_simple ("video/mpeg",
"systemstream", G_TYPE_BOOLEAN, FALSE,
"mpegversion", G_TYPE_INT, 1, NULL);
if (codec_name)
*codec_name = g_strdup ("MPEG-1 video");
break;
+
case GST_MAKE_FOURCC ('M', 'P', 'G', '2'):
case GST_MAKE_FOURCC ('m', 'p', 'g', '2'):
+ case GST_MAKE_FOURCC ('P', 'I', 'M', '2'):
+ case GST_MAKE_FOURCC ('D', 'V', 'R', ' '):
+ case GST_MAKE_FOURCC (0x02, 0x00, 0x00, 0x10):
caps = gst_caps_new_simple ("video/mpeg",
"systemstream", G_TYPE_BOOLEAN, FALSE,
"mpegversion", G_TYPE_INT, 2, NULL);
@@ -178,10 +215,20 @@
*codec_name = g_strdup ("MPEG-2 video");
break;
+ case GST_MAKE_FOURCC ('L', 'M', 'P', '2'):
+ caps = gst_caps_new_simple ("video/mpeg",
+ "systemstream", G_TYPE_BOOLEAN, FALSE,
+ "mpegversion", G_TYPE_INT, 2, NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Lead MPEG-2 video");
+ break;
+
case GST_MAKE_FOURCC ('H', '2', '6', '3'):
case GST_MAKE_FOURCC ('h', '2', '6', '3'):
case GST_MAKE_FOURCC ('i', '2', '6', '3'):
case GST_MAKE_FOURCC ('U', '2', '6', '3'):
+ case GST_MAKE_FOURCC ('v', 'i', 'v', '1'):
+ case GST_MAKE_FOURCC ('T', '2', '6', '3'):
caps = gst_caps_new_simple ("video/x-h263",
"variant", G_TYPE_STRING, "itu", NULL);
if (codec_name)
@@ -233,6 +280,15 @@
*codec_name = g_strdup ("Intel H.263");
break;
+ case GST_MAKE_FOURCC ('V', 'X', '1', 'K'):
+ caps = gst_caps_new_simple ("video/x-h263",
+ "variant", G_TYPE_STRING, "lucent", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Lucent VX1000S H.263");
+ break;
+
+ case GST_MAKE_FOURCC ('X', '2', '6', '4'):
+ case GST_MAKE_FOURCC ('x', '2', '6', '4'):
case GST_MAKE_FOURCC ('H', '2', '6', '4'):
case GST_MAKE_FOURCC ('h', '2', '6', '4'):
case GST_MAKE_FOURCC ('a', 'v', 'c', '1'):
@@ -250,6 +306,14 @@
*codec_name = g_strdup ("VideoSoft H.264");
break;
+ case GST_MAKE_FOURCC ('L', '2', '6', '4'):
+ /* http://www.leadcodecs.com/Codecs/LEAD-H264.htm */
+ caps = gst_caps_new_simple ("video/x-h264",
+ "variant", G_TYPE_STRING, "lead", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Lead H.264");
+ break;
+
case GST_MAKE_FOURCC ('S', 'E', 'D', 'G'):
caps = gst_caps_new_simple ("video/mpeg",
"mpegversion", G_TYPE_INT, 4, NULL);
@@ -257,8 +321,17 @@
*codec_name = g_strdup ("Samsung MPEG-4");
break;
+ case GST_MAKE_FOURCC ('M', '4', 'C', 'C'):
+ caps = gst_caps_new_simple ("video/mpeg",
+ "mpegversion", G_TYPE_INT, 4, NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Divio MPEG-4");
+ break;
+
case GST_MAKE_FOURCC ('D', 'I', 'V', '3'):
case GST_MAKE_FOURCC ('d', 'i', 'v', '3'):
+ case GST_MAKE_FOURCC ('D', 'V', 'X', '3'):
+ case GST_MAKE_FOURCC ('d', 'v', 'x', '3'):
case GST_MAKE_FOURCC ('D', 'I', 'V', '4'):
case GST_MAKE_FOURCC ('d', 'i', 'v', '4'):
case GST_MAKE_FOURCC ('D', 'I', 'V', '5'):
@@ -308,7 +381,8 @@
break;
case GST_MAKE_FOURCC ('M', 'P', 'G', '4'):
- case GST_MAKE_FOURCC ('M', 'P', '4', 'S'):
+ case GST_MAKE_FOURCC ('M', 'P', '4', '1'):
+ case GST_MAKE_FOURCC ('m', 'p', '4', '1'):
caps = gst_caps_new_simple ("video/x-msmpeg",
"msmpegversion", G_TYPE_INT, 41, NULL);
if (codec_name)
@@ -331,6 +405,7 @@
*codec_name = g_strdup ("Microsoft MPEG-4 4.3");
break;
+ case GST_MAKE_FOURCC ('M', 'P', '4', 'S'):
case GST_MAKE_FOURCC ('M', '4', 'S', '2'):
caps = gst_caps_new_simple ("video/mpeg",
"mpegversion", G_TYPE_INT, 4, NULL);
@@ -340,17 +415,40 @@
case GST_MAKE_FOURCC ('F', 'M', 'P', '4'):
case GST_MAKE_FOURCC ('U', 'M', 'P', '4'):
+ case GST_MAKE_FOURCC ('F', 'F', 'D', 'S'):
caps = gst_caps_new_simple ("video/mpeg",
"mpegversion", G_TYPE_INT, 4, NULL);
if (codec_name)
*codec_name = g_strdup ("FFmpeg MPEG-4");
break;
+ case GST_MAKE_FOURCC ('E', 'M', '4', 'A'):
+ case GST_MAKE_FOURCC ('E', 'P', 'V', 'H'):
+ case GST_MAKE_FOURCC ('F', 'V', 'F', 'W'):
+ case GST_MAKE_FOURCC ('I', 'N', 'M', 'C'):
+ case GST_MAKE_FOURCC ('D', 'I', 'G', 'I'):
+ case GST_MAKE_FOURCC ('D', 'M', '2', 'K'):
+ case GST_MAKE_FOURCC ('D', 'C', 'O', 'D'):
+ case GST_MAKE_FOURCC ('M', 'V', 'X', 'M'):
+ case GST_MAKE_FOURCC ('P', 'M', '4', 'V'):
+ case GST_MAKE_FOURCC ('S', 'M', 'P', '4'):
+ case GST_MAKE_FOURCC ('D', 'X', 'G', 'M'):
+ case GST_MAKE_FOURCC ('V', 'I', 'D', 'M'):
+ case GST_MAKE_FOURCC ('M', '4', 'T', '3'):
+ case GST_MAKE_FOURCC ('G', 'E', 'O', 'X'):
+ caps = gst_caps_new_simple ("video/mpeg",
+ "mpegversion", G_TYPE_INT, 4, NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("MPEG-4");
+ break;
+
case GST_MAKE_FOURCC ('3', 'i', 'v', 'd'):
case GST_MAKE_FOURCC ('3', 'I', 'V', 'D'):
+ caps = gst_caps_new_simple ("video/x-msmpeg",
+ "msmpegversion", G_TYPE_INT, 43, NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft MPEG-4 4.3"); /* FIXME? */
- return gst_caps_from_string ("video/x-msmpeg, msmpegversion = (int) 43");
+ break;
case GST_MAKE_FOURCC ('3', 'I', 'V', '1'):
case GST_MAKE_FOURCC ('3', 'I', 'V', '2'):
@@ -361,13 +459,33 @@
case GST_MAKE_FOURCC ('D', 'V', 'S', 'D'):
case GST_MAKE_FOURCC ('d', 'v', 's', 'd'):
- case GST_MAKE_FOURCC ('C', 'D', 'V', 'C'):
+ case GST_MAKE_FOURCC ('d', 'v', 'c', ' '):
+ case GST_MAKE_FOURCC ('d', 'v', '2', '5'):
caps = gst_caps_new_simple ("video/x-dv",
- "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
+ "systemstream", G_TYPE_BOOLEAN, FALSE,
+ "dvversion", G_TYPE_INT, 25, NULL);
if (codec_name)
*codec_name = g_strdup ("Generic DV");
break;
+ case GST_MAKE_FOURCC ('C', 'D', 'V', 'C'):
+ case GST_MAKE_FOURCC ('c', 'd', 'v', 'c'):
+ caps = gst_caps_new_simple ("video/x-dv",
+ "systemstream", G_TYPE_BOOLEAN, FALSE,
+ "dvversion", G_TYPE_INT, 25, NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Canopus DV");
+ break;
+
+ case GST_MAKE_FOURCC ('D', 'V', '5', '0'):
+ case GST_MAKE_FOURCC ('d', 'v', '5', '0'):
+ caps = gst_caps_new_simple ("video/x-dv",
+ "systemstream", G_TYPE_BOOLEAN, FALSE,
+ "dvversion", G_TYPE_INT, 50, NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("DVCPro50 Video");
+ break;
+
case GST_MAKE_FOURCC ('W', 'M', 'V', '1'):
caps = gst_caps_new_simple ("video/x-wmv",
"wmvversion", G_TYPE_INT, 1, NULL);
@@ -391,7 +509,7 @@
case GST_MAKE_FOURCC ('W', 'M', 'V', 'A'):
caps = gst_caps_new_simple ("video/x-wmv",
- "wmvversion", G_TYPE_INT, 3, "fourcc", GST_TYPE_FOURCC,
+ "wmvversion", G_TYPE_INT, 3, "format", GST_TYPE_FOURCC,
codec_fcc, NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft Windows Media Advanced Profile");
@@ -399,7 +517,7 @@
case GST_MAKE_FOURCC ('W', 'V', 'C', '1'):
caps = gst_caps_new_simple ("video/x-wmv",
- "wmvversion", G_TYPE_INT, 3, "fourcc", GST_TYPE_FOURCC,
+ "wmvversion", G_TYPE_INT, 3, "format", GST_TYPE_FOURCC,
codec_fcc, NULL);
if (codec_name)
*codec_name = g_strdup ("Microsoft Windows Media VC-1");
@@ -428,6 +546,7 @@
case GST_MAKE_FOURCC ('R', 'L', 'E', ' '):
case GST_MAKE_FOURCC ('m', 'r', 'l', 'e'):
case GST_MAKE_FOURCC (0x1, 0x0, 0x0, 0x0): /* why, why, why? */
+ case GST_MAKE_FOURCC (0x2, 0x0, 0x0, 0x0): /* why, why, why? */
caps = gst_caps_new_simple ("video/x-rle",
"layout", G_TYPE_STRING, "microsoft", NULL);
palette = strf_data;
@@ -494,6 +613,7 @@
break;
case GST_MAKE_FOURCC ('C', 'L', 'J', 'R'):
+ case GST_MAKE_FOURCC ('c', 'l', 'j', 'r'):
caps = gst_caps_new_simple ("video/x-cirrus-logic-accupak", NULL);
if (codec_name)
*codec_name = g_strdup ("Cirrus Logipak AccuPak");
@@ -507,6 +627,7 @@
break;
case GST_MAKE_FOURCC ('D', 'U', 'C', 'K'):
+ case GST_MAKE_FOURCC ('P', 'V', 'E', 'Z'):
caps = gst_caps_new_simple ("video/x-truemotion",
"trueversion", G_TYPE_INT, 1, NULL);
if (codec_name)
@@ -608,6 +729,56 @@
*codec_name = g_strdup ("Dirac");
break;
+ case GST_RIFF_rpza:
+ case GST_RIFF_azpr:
+ case GST_MAKE_FOURCC ('R', 'P', 'Z', 'A'):
+ caps = gst_caps_new_simple ("video/x-apple-video", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Apple Video (RPZA)");
+ break;
+
+
+ case GST_MAKE_FOURCC ('F', 'F', 'V', '1'):
+ caps = gst_caps_new_simple ("video/x-ffv",
+ "ffvversion", G_TYPE_INT, 1, NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("FFmpeg lossless video codec");
+ break;
+
+ case GST_MAKE_FOURCC ('K', 'M', 'V', 'C'):
+ caps = gst_caps_new_simple ("video/x-kmvc", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Karl Morton's video codec");
+ break;
+
+ case GST_MAKE_FOURCC ('v', 'p', '6', '0'):
+ case GST_MAKE_FOURCC ('V', 'P', '6', '0'):
+ caps = gst_caps_new_simple ("video/x-vp6", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("On2 VP6");
+ break;
+
+ case GST_MAKE_FOURCC ('L', 'M', '2', '0'):
+ caps = gst_caps_new_simple ("video/x-mimic", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Mimic webcam");
+ break;
+
+ case GST_MAKE_FOURCC ('T', 'H', 'E', 'O'):
+ case GST_MAKE_FOURCC ('t', 'h', 'e', 'o'):
+ caps = gst_caps_new_simple ("video/x-theora", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Theora video codec");
+
+ break;
+
+ case GST_MAKE_FOURCC ('F', 'P', 'S', '1'):
+ caps = gst_caps_new_simple ("video/x-fraps", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Fraps video");
+
+ break;
+
default:
GST_WARNING ("Unknown video fourcc %" GST_FOURCC_FORMAT,
GST_FOURCC_ARGS (codec_fcc));
@@ -634,8 +805,11 @@
/* extradata */
if (strf_data || strd_data) {
- gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER,
- strf_data ? strf_data : strd_data, NULL);
+ GstBuffer *codec_data;
+
+ codec_data = strf_data ? strf_data : strd_data;
+
+ gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, codec_data, NULL);
}
/* palette */
@@ -862,6 +1036,7 @@
switch (codec_id) {
case GST_RIFF_WAVE_FORMAT_PCM: /* PCM */
+ rate_max = 192000;
channels_max = 8;
if (strf != NULL) {
@@ -927,6 +1102,7 @@
break;
case GST_RIFF_WAVE_FORMAT_IEEE_FLOAT:
+ rate_max = 192000;
channels_max = 8;
if (strf != NULL) {
@@ -969,14 +1145,14 @@
GST_WARNING ("invalid depth (%d) of alaw audio, overwriting.",
strf->size);
strf->size = 8;
- strf->av_bps = 8;
- strf->blockalign = strf->av_bps * strf->channels;
+ strf->blockalign = (strf->size * strf->channels) / 8;
+ strf->av_bps = strf->blockalign * strf->rate;
}
if (strf->av_bps == 0 || strf->blockalign == 0) {
GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of alaw audio",
strf->av_bps, strf->blockalign);
- strf->av_bps = strf->size;
- strf->blockalign = strf->av_bps * strf->channels;
+ strf->blockalign = (strf->size * strf->channels) / 8;
+ strf->av_bps = strf->blockalign * strf->rate;
}
}
rate_max = 48000;
@@ -1007,14 +1183,14 @@
GST_WARNING ("invalid depth (%d) of mulaw audio, overwriting.",
strf->size);
strf->size = 8;
- strf->av_bps = 8;
- strf->blockalign = strf->av_bps * strf->channels;
+ strf->blockalign = (strf->size * strf->channels) / 8;
+ strf->av_bps = strf->blockalign * strf->rate;
}
if (strf->av_bps == 0 || strf->blockalign == 0) {
GST_WARNING ("fixing av_bps (%d) and blockalign (%d) of mulaw audio",
strf->av_bps, strf->blockalign);
- strf->av_bps = strf->size;
- strf->blockalign = strf->av_bps * strf->channels;
+ strf->blockalign = (strf->size * strf->channels) / 8;
+ strf->av_bps = strf->blockalign * strf->rate;
}
}
rate_max = 48000;
@@ -1035,8 +1211,17 @@
block_align = TRUE;
break;
+ case GST_RIFF_WAVE_FORMAT_DSP_TRUESPEECH:
+ rate_min = 8000;
+ rate_max = 8000;
+ caps = gst_caps_new_simple ("audio/x-truespeech", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("DSP Group TrueSpeech");
+ break;
+
case GST_RIFF_WAVE_FORMAT_GSM610:
case GST_RIFF_WAVE_FORMAT_MSN:
+ rate_min = 1;
caps = gst_caps_new_simple ("audio/ms-gsm", NULL);
if (codec_name)
*codec_name = g_strdup ("MS GSM audio");
@@ -1060,12 +1245,31 @@
*codec_name = g_strdup ("MPEG-1 layer 3");
break;
+ case GST_RIFF_WAVE_FORMAT_AMR_NB: /* amr-nb */
+ rate_min = 8000;
+ rate_max = 8000;
+ channels_max = 1;
+ caps = gst_caps_new_simple ("audio/AMR", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("AMR Narrow Band (NB)");
+ break;
+
+ case GST_RIFF_WAVE_FORMAT_AMR_WB: /* amr-wb */
+ rate_min = 16000;
+ rate_max = 16000;
+ channels_max = 1;
+ caps = gst_caps_new_simple ("audio/AMR-WB", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("AMR Wide Band (WB)");
+ break;
+
case GST_RIFF_WAVE_FORMAT_VORBIS1: /* ogg/vorbis mode 1 */
case GST_RIFF_WAVE_FORMAT_VORBIS2: /* ogg/vorbis mode 2 */
case GST_RIFF_WAVE_FORMAT_VORBIS3: /* ogg/vorbis mode 3 */
case GST_RIFF_WAVE_FORMAT_VORBIS1PLUS: /* ogg/vorbis mode 1+ */
case GST_RIFF_WAVE_FORMAT_VORBIS2PLUS: /* ogg/vorbis mode 2+ */
case GST_RIFF_WAVE_FORMAT_VORBIS3PLUS: /* ogg/vorbis mode 3+ */
+ rate_max = 192000;
caps = gst_caps_new_simple ("audio/x-vorbis", NULL);
if (codec_name)
*codec_name = g_strdup ("Vorbis");
@@ -1086,6 +1290,8 @@
rate_chan = FALSE;
break;
case GST_RIFF_WAVE_FORMAT_AAC:
+ case GST_RIFF_WAVE_FORMAT_AAC_AC:
+ case GST_RIFF_WAVE_FORMAT_AAC_pm:
{
channels_max = 8;
caps = gst_caps_new_simple ("audio/mpeg",
@@ -1097,6 +1303,7 @@
case GST_RIFF_WAVE_FORMAT_WMAV1:
case GST_RIFF_WAVE_FORMAT_WMAV2:
case GST_RIFF_WAVE_FORMAT_WMAV3:
+ case GST_RIFF_WAVE_FORMAT_WMAV3_L:
{
gint version = (codec_id - GST_RIFF_WAVE_FORMAT_WMAV1) + 1;
@@ -1106,8 +1313,12 @@
caps = gst_caps_new_simple ("audio/x-wma",
"wmaversion", G_TYPE_INT, version, NULL);
- if (codec_name)
- *codec_name = g_strdup_printf ("WMA Version %d", version + 6);
+ if (codec_name) {
+ if (codec_id == GST_RIFF_WAVE_FORMAT_WMAV3_L)
+ *codec_name = g_strdup ("WMA Lossless");
+ else
+ *codec_name = g_strdup_printf ("WMA Version %d", version + 6);
+ }
if (strf != NULL) {
gst_caps_set_simple (caps,
@@ -1119,17 +1330,50 @@
}
break;
}
- case GST_RIFF_WAVE_FORMAT_WMAV3_L:
- {
- /* WMA Version 9 Lossless */
- goto unknown;
- }
case GST_RIFF_WAVE_FORMAT_SONY_ATRAC3:
caps = gst_caps_new_simple ("audio/x-vnd.sony.atrac3", NULL);
if (codec_name)
*codec_name = g_strdup ("Sony ATRAC3");
break;
+ case GST_RIFF_WAVE_FORMAT_SIREN:
+ caps = gst_caps_new_simple ("audio/x-siren", NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("Siren7");
+ rate_chan = FALSE;
+ break;
+
+ case GST_RIFF_WAVE_FORMAT_ADPCM_IMA_DK4:
+ rate_min = 8000;
+ rate_max = 96000;
+ channels_max = 2;
+ caps =
+ gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "dk4",
+ NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("IMA/DK4 ADPCM");
+ break;
+ case GST_RIFF_WAVE_FORMAT_ADPCM_IMA_DK3:
+ rate_min = 8000;
+ rate_max = 96000;
+ channels_max = 2;
+ caps =
+ gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "dk3",
+ NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("IMA/DK3 ADPCM");
+ break;
+
+ case GST_RIFF_WAVE_FORMAT_ADPCM_IMA_WAV:
+ rate_min = 8000;
+ rate_max = 96000;
+ channels_max = 2;
+ caps =
+ gst_caps_new_simple ("audio/x-adpcm", "layout", G_TYPE_STRING, "dvi",
+ NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("IMA/WAV ADPCM");
+ break;
case GST_RIFF_WAVE_FORMAT_EXTENSIBLE:{
guint16 valid_bits_per_sample;
guint32 channel_mask;
@@ -1307,8 +1551,6 @@
break;
}
/* can anything decode these? pitfdll? */
- case GST_RIFF_WAVE_FORMAT_VOXWARE:
- case GST_RIFF_WAVE_FORMAT_VOXWARE_BYTE_ALIGNED:
case GST_RIFF_WAVE_FORMAT_VOXWARE_AC8:
case GST_RIFF_WAVE_FORMAT_VOXWARE_AC10:
case GST_RIFF_WAVE_FORMAT_VOXWARE_AC16:
@@ -1349,9 +1591,16 @@
}
} else {
if (rate_chan) {
- gst_caps_set_simple (caps,
- "rate", GST_TYPE_INT_RANGE, rate_min, rate_max,
- "channels", GST_TYPE_INT_RANGE, 1, channels_max, NULL);
+ if (rate_min == rate_max)
+ gst_caps_set_simple (caps, "rate", G_TYPE_INT, rate_min, NULL);
+ else
+ gst_caps_set_simple (caps,
+ "rate", GST_TYPE_INT_RANGE, rate_min, rate_max, NULL);
+ if (channels_max == 1)
+ gst_caps_set_simple (caps, "channels", G_TYPE_INT, 1, NULL);
+ else
+ gst_caps_set_simple (caps,
+ "channels", GST_TYPE_INT_RANGE, 1, channels_max, NULL);
}
if (block_align) {
gst_caps_set_simple (caps,
@@ -1434,9 +1683,12 @@
GST_MAKE_FOURCC ('D', 'I', 'V', 'X'),
GST_MAKE_FOURCC ('D', 'U', 'C', 'K'),
GST_MAKE_FOURCC ('D', 'V', 'S', 'D'),
+ GST_MAKE_FOURCC ('D', 'V', '5', '0'),
GST_MAKE_FOURCC ('D', 'X', '5', '0'),
+ GST_MAKE_FOURCC ('M', '4', 'C', 'C'),
GST_MAKE_FOURCC ('F', 'L', 'V', '1'),
GST_MAKE_FOURCC ('H', '2', '6', '3'),
+ GST_MAKE_FOURCC ('V', 'X', '1', 'K'),
GST_MAKE_FOURCC ('H', '2', '6', '4'),
GST_MAKE_FOURCC ('H', 'F', 'Y', 'U'),
GST_MAKE_FOURCC ('I', '2', '6', '3'),
@@ -1445,6 +1697,7 @@
GST_MAKE_FOURCC ('I', 'V', '4', '1'),
GST_MAKE_FOURCC ('I', 'V', '5', '0'),
GST_MAKE_FOURCC ('L', '2', '6', '3'),
+ GST_MAKE_FOURCC ('L', '2', '6', '4'),
GST_MAKE_FOURCC ('M', '2', '6', '3'),
GST_MAKE_FOURCC ('M', '4', 'S', '2'),
GST_MAKE_FOURCC ('M', 'J', 'P', 'G'),
@@ -1461,6 +1714,7 @@
GST_MAKE_FOURCC ('T', 'M', '2', '0'),
GST_MAKE_FOURCC ('T', 'S', 'C', 'C'),
GST_MAKE_FOURCC ('U', 'L', 'T', 'I'),
+ GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'),
GST_MAKE_FOURCC ('V', 'C', 'R', '1'),
GST_MAKE_FOURCC ('V', 'C', 'R', '2'),
GST_MAKE_FOURCC ('V', 'D', 'O', 'W'),
@@ -1480,8 +1734,15 @@
GST_MAKE_FOURCC ('h', '2', '6', '4'),
GST_MAKE_FOURCC ('m', 's', 'v', 'c'),
GST_MAKE_FOURCC ('x', '2', '6', '3'),
- GST_MAKE_FOURCC ('d', 'r', 'a', 'c')
- /* FILL ME */
+ GST_MAKE_FOURCC ('d', 'r', 'a', 'c'),
+ GST_MAKE_FOURCC ('F', 'F', 'V', '1'),
+ GST_MAKE_FOURCC ('K', 'M', 'V', 'C'),
+ GST_MAKE_FOURCC ('V', 'P', '6', '0'),
+ GST_MAKE_FOURCC ('L', 'M', '2', '0'),
+ GST_MAKE_FOURCC ('R', 'P', 'Z', 'A'),
+ GST_MAKE_FOURCC ('T', 'H', 'E', 'O'),
+ GST_MAKE_FOURCC ('F', 'P', 'S', '1'),
+ /* FILL ME */
};
guint i;
GstCaps *caps, *one;
@@ -1517,13 +1778,20 @@
GST_RIFF_WAVE_FORMAT_WMS,
GST_RIFF_WAVE_FORMAT_ADPCM,
GST_RIFF_WAVE_FORMAT_DVI_ADPCM,
+ GST_RIFF_WAVE_FORMAT_DSP_TRUESPEECH,
GST_RIFF_WAVE_FORMAT_WMAV1,
GST_RIFF_WAVE_FORMAT_WMAV2,
GST_RIFF_WAVE_FORMAT_WMAV3,
GST_RIFF_WAVE_FORMAT_SONY_ATRAC3,
GST_RIFF_WAVE_FORMAT_IEEE_FLOAT,
- GST_RIFF_WAVE_FORMAT_VOXWARE
- /* FILL ME */
+ GST_RIFF_WAVE_FORMAT_VOXWARE_METASOUND,
+ GST_RIFF_WAVE_FORMAT_ADPCM_IMA_DK4,
+ GST_RIFF_WAVE_FORMAT_ADPCM_IMA_DK3,
+ GST_RIFF_WAVE_FORMAT_ADPCM_IMA_WAV,
+ GST_RIFF_WAVE_FORMAT_AMR_NB,
+ GST_RIFF_WAVE_FORMAT_AMR_WB,
+ GST_RIFF_WAVE_FORMAT_SIREN,
+ /* FILL ME */
};
guint i;
GstCaps *caps, *one;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/riff/riff-read.c
--- a/gst_plugins_base/gst-libs/gst/riff/riff-read.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/riff/riff-read.c Wed Mar 24 18:04:17 2010 -0500
@@ -161,6 +161,10 @@
GST_DEBUG_OBJECT (element, "fourcc=%" GST_FOURCC_FORMAT ", size=%u",
GST_FOURCC_ARGS (fourcc), size);
+ /* be paranoid: size may be nonsensical value here, such as (guint) -1 */
+ if (G_UNLIKELY (size > G_MAXINT))
+ goto bogus_size;
+
if (bufsize < size + 8 + offset) {
GST_DEBUG_OBJECT (element,
"Needed chunk data (%d) is more than available (%d), shortcutting",
@@ -191,6 +195,11 @@
offset, bufsize, 8);
return FALSE;
}
+bogus_size:
+ {
+ GST_ERROR_OBJECT (element, "Broken file: bogus chunk size %u", size);
+ return FALSE;
+ }
}
/**
@@ -646,6 +655,10 @@
tsize = GST_READ_UINT32_LE (data + 4);
size -= 8;
data += 8;
+
+ GST_DEBUG ("tag %" GST_FOURCC_FORMAT ", size %u",
+ GST_FOURCC_ARGS (tag), tsize);
+
if (tsize > size) {
GST_WARNING_OBJECT (element,
"Tagsize %d is larger than available data %d", tsize, size);
@@ -688,7 +701,7 @@
type = GST_TAG_GENRE;
break;
case GST_RIFF_INFO_IKEY:
- type = NULL; /*"Keywords"; */ ;
+ type = GST_TAG_KEYWORDS;
break;
case GST_RIFF_INFO_ILGT:
type = NULL; /*"Lightness"; */
@@ -747,6 +760,12 @@
}
}
+ if (tsize & 1) {
+ tsize++;
+ if (tsize > size)
+ tsize = size;
+ }
+
data += tsize;
size -= tsize;
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/riff/riff.c
--- a/gst_plugins_base/gst-libs/gst/riff/riff.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/riff/riff.c Wed Mar 24 18:04:17 2010 -0500
@@ -1,7 +1,7 @@
/* GStreamer RIFF I/O
* Copyright (C) 2003 Ronald Bultje
*
- * riff.c: plugin registering
+ * riff.c: library initialisation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -18,6 +18,13 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+/**
+ * SECTION:gstriff
+ * @short_description: Riff fileformat utillity functions.
+ *
+ * A collection of functions to handle riff base files, such as avi, wav and
+ * asf.
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -26,11 +33,16 @@
#include
GST_DEBUG_CATEGORY (riff_debug);
+
+/**
+ * gst_riff_init:
+ *
+ * Initialize riff library.
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
void
gst_riff_init (void)
{
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/README
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/rtp/README Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,66 @@
+The RTP libraries
+---------------------
+
+ RTP Buffers
+ -----------
+ The real time protocol as described in RFC 3550 requires the use of special
+ packets containing an additional RTP header of at least 12 bytes. GStreamer
+ provides some helper functions for creating and parsing these RTP headers.
+ The result is a normal #GstBuffer with an additional RTP header.
+
+ RTP buffers are usually created with gst_rtp_buffer_new_allocate() or
+ gst_rtp_buffer_new_allocate_len(). These functions create buffers with a
+ preallocated space of memory. It will also ensure that enough memory
+ is allocated for the RTP header. The first function is used when the payload
+ size is known. gst_rtp_buffer_new_allocate_len() should be used when the size
+ of the whole RTP buffer (RTP header + payload) is known.
+
+ When receiving RTP buffers from a network, gst_rtp_buffer_new_take_data()
+ should be used when the user would like to parse that RTP packet. (TODO Ask
+ Wim what the real purpose of this function is as it seems to simply create a
+ duplicate GstBuffer with the same data as the previous one). The
+ function will create a new RTP buffer with the given data as the whole RTP
+ packet. Alternatively, gst_rtp_buffer_new_copy_data() can be used if the user
+ wishes to make a copy of the data before using it in the new RTP buffer. An
+ important function is gst_rtp_buffer_validate() that is used to verify that
+ the buffer a well formed RTP buffer.
+
+ It is now possible to use all the gst_rtp_buffer_get_*() or
+ gst_rtp_buffer_set_*() functions to read or write the different parts of the
+ RTP header such as the payload type, the sequence number or the RTP
+ timestamp. The use can also retreive a pointer to the actual RTP payload data
+ using the gst_rtp_buffer_get_payload() function.
+
+ RTP Base Payloader Class (GstBaseRTPPayload)
+ --------------------------------------------
+
+ All RTP payloader elements (audio or video) should derive from this class.
+
+ RTP Base Audio Payloader Class (GstBaseRTPAudioPayload)
+ -------------------------------------------------------
+
+ This base class can be tested through it's children classes. Here is an
+ example using the iLBC payloader (frame based).
+
+ For 20ms mode :
+
+ GST_DEBUG="basertpaudiopayload:5" gst-launch-0.10 fakesrc sizetype=2
+ sizemax=114 datarate=1900 ! audio/x-iLBC, mode=20 ! rtpilbcpay
+ max-ptime="40000000" ! fakesink
+
+ For 30ms mode :
+
+ GST_DEBUG="basertpaudiopayload:5" gst-launch-0.10 fakesrc sizetype=2
+ sizemax=150 datarate=1662 ! audio/x-iLBC, mode=30 ! rtpilbcpay
+ max-ptime="60000000" ! fakesink
+
+ Here is an example using the uLaw payloader (sample based).
+
+ GST_DEBUG="basertpaudiopayload:5" gst-launch-0.10 fakesrc sizetype=2
+ sizemax=150 datarate=8000 ! audio/x-mulaw ! rtppcmupay max-ptime="6000000" !
+ fakesink
+
+ RTP Base Depayloader Class (GstBaseRTPDepayload)
+ ------------------------------------------------
+
+ All RTP depayloader elements (audio or video) should derive from this class.
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/gstbasertpaudiopayload.c
--- a/gst_plugins_base/gst-libs/gst/rtp/gstbasertpaudiopayload.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtp/gstbasertpaudiopayload.c Wed Mar 24 18:04:17 2010 -0500
@@ -110,10 +110,6 @@
GST_BOILERPLATE (GstBaseRTPAudioPayload, gst_base_rtp_audio_payload,
GstBaseRTPPayload, GST_TYPE_BASE_RTP_PAYLOAD);
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
static void
gst_base_rtp_audio_payload_base_init (gpointer klass)
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/gstbasertpdepayload.c
--- a/gst_plugins_base/gst-libs/gst/rtp/gstbasertpdepayload.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtp/gstbasertpdepayload.c Wed Mar 24 18:04:17 2010 -0500
@@ -56,6 +56,10 @@
gboolean discont;
GstClockTime timestamp;
GstClockTime duration;
+
+ guint32 next_seqnum;
+
+ gboolean negotiated;
};
/* Filter signals and args */
@@ -70,7 +74,8 @@
enum
{
PROP_0,
- PROP_QUEUE_DELAY
+ PROP_QUEUE_DELAY,
+ PROP_LAST
};
static void gst_base_rtp_depayload_finalize (GObject * object);
@@ -90,6 +95,8 @@
static void gst_base_rtp_depayload_set_gst_timestamp
(GstBaseRTPDepayload * filter, guint32 rtptime, GstBuffer * buf);
+static gboolean gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload *
+ filter, GstEvent * event);
GST_BOILERPLATE (GstBaseRTPDepayload, gst_base_rtp_depayload, GstElement,
GST_TYPE_ELEMENT);
@@ -128,12 +135,13 @@
g_object_class_install_property (gobject_class, PROP_QUEUE_DELAY,
g_param_spec_uint ("queue-delay", "Queue Delay",
"Amount of ms to queue/buffer, deprecated", 0, G_MAXUINT,
- DEFAULT_QUEUE_DELAY, G_PARAM_READWRITE));
+ DEFAULT_QUEUE_DELAY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#endif
gstelement_class->change_state = gst_base_rtp_depayload_change_state;
klass->set_gst_timestamp = gst_base_rtp_depayload_set_gst_timestamp;
+ klass->packet_lost = gst_base_rtp_depayload_packet_lost;
GST_DEBUG_CATEGORY_INIT (basertpdepayload_debug, "basertpdepayload", 0,
"Base class for RTP Depayloaders");
@@ -237,6 +245,8 @@
else
res = TRUE;
+ priv->negotiated = res;
+
gst_object_unref (filter);
return res;
@@ -251,29 +261,89 @@
GstFlowReturn ret = GST_FLOW_OK;
GstBuffer *out_buf;
GstClockTime timestamp;
+ guint16 seqnum;
+ guint32 rtptime;
+ gboolean reset_seq, discont;
+ gint gap;
filter = GST_BASE_RTP_DEPAYLOAD (GST_OBJECT_PARENT (pad));
+ priv = filter->priv;
- priv = filter->priv;
+ /* we must have a setcaps first */
+ if (G_UNLIKELY (!priv->negotiated))
+ goto not_negotiated;
+
+ /* we must validate, it's possible that this element is plugged right after a
+ * network receiver and we don't want to operate on invalid data */
+ if (G_UNLIKELY (!gst_rtp_buffer_validate (in)))
+ goto invalid_buffer;
+
priv->discont = GST_BUFFER_IS_DISCONT (in);
+ timestamp = GST_BUFFER_TIMESTAMP (in);
/* convert to running_time and save the timestamp, this is the timestamp
* we put on outgoing buffers. */
- timestamp = GST_BUFFER_TIMESTAMP (in);
timestamp = gst_segment_to_running_time (&filter->segment, GST_FORMAT_TIME,
timestamp);
priv->timestamp = timestamp;
priv->duration = GST_BUFFER_DURATION (in);
+ seqnum = gst_rtp_buffer_get_seq (in);
+ rtptime = gst_rtp_buffer_get_timestamp (in);
+ reset_seq = TRUE;
+ discont = FALSE;
+
+ GST_LOG_OBJECT (filter, "discont %d, seqnum %u, rtptime %u, timestamp %"
+ GST_TIME_FORMAT, priv->discont, seqnum, rtptime,
+ GST_TIME_ARGS (timestamp));
+
+ /* Check seqnum. This is a very simple check that makes sure that the seqnums
+ * are striclty increasing, dropping anything that is out of the ordinary. We
+ * can only do this when the next_seqnum is known. */
+ if (G_LIKELY (priv->next_seqnum != -1)) {
+ gap = gst_rtp_buffer_compare_seqnum (seqnum, priv->next_seqnum);
+
+ /* if we have no gap, all is fine */
+ if (G_UNLIKELY (gap != 0)) {
+ GST_LOG_OBJECT (filter, "got packet %u, expected %u, gap %d", seqnum,
+ priv->next_seqnum, gap);
+ if (gap < 0) {
+ /* seqnum > next_seqnum, we are missing some packets, this is always a
+ * DISCONT. */
+ GST_LOG_OBJECT (filter, "%d missing packets", gap);
+ discont = TRUE;
+ } else {
+ /* seqnum < next_seqnum, we have seen this packet before or the sender
+ * could be restarted. If the packet is not too old, we throw it away as
+ * a duplicate, otherwise we mark discont and continue. 100 misordered
+ * packets is a good threshold. See also RFC 4737. */
+ if (gap < 100)
+ goto dropping;
+
+ GST_LOG_OBJECT (filter,
+ "%d > 100, packet too old, sender likely restarted", gap);
+ discont = TRUE;
+ }
+ }
+ }
+ priv->next_seqnum = (seqnum + 1) & 0xffff;
+
+ if (G_UNLIKELY (discont && !priv->discont)) {
+ GST_LOG_OBJECT (filter, "mark DISCONT on input buffer");
+ /* we detected a seqnum discont but the buffer was not flagged with a discont,
+ * set the discont flag so that the subclass can throw away old data. */
+ priv->discont = TRUE;
+ GST_BUFFER_FLAG_SET (in, GST_BUFFER_FLAG_DISCONT);
+ }
+
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
+ if (G_UNLIKELY (bclass->process == NULL))
+ goto no_process;
+
/* let's send it out to processing */
out_buf = bclass->process (filter, in);
if (out_buf) {
- guint32 rtptime;
-
- rtptime = gst_rtp_buffer_get_timestamp (in);
-
/* we pass rtptime as backward compatibility, in reality, the incomming
* buffer timestamp is always applied to the outgoing packet. */
ret = gst_base_rtp_depayload_push_ts (filter, rtptime, out_buf);
@@ -281,6 +351,38 @@
gst_buffer_unref (in);
return ret;
+
+ /* ERRORS */
+not_negotiated:
+ {
+ /* this is not fatal but should be filtered earlier */
+ GST_ELEMENT_ERROR (filter, CORE, NEGOTIATION, (NULL),
+ ("Not RTP format was negotiated"));
+ gst_buffer_unref (in);
+ return GST_FLOW_NOT_NEGOTIATED;
+ }
+invalid_buffer:
+ {
+ /* this is not fatal but should be filtered earlier */
+ GST_ELEMENT_WARNING (filter, STREAM, DECODE, (NULL),
+ ("Received invalid RTP payload, dropping"));
+ gst_buffer_unref (in);
+ return GST_FLOW_OK;
+ }
+dropping:
+ {
+ GST_WARNING_OBJECT (filter, "%d <= 100, dropping old packet", gap);
+ gst_buffer_unref (in);
+ return GST_FLOW_OK;
+ }
+no_process:
+ {
+ /* this is not fatal but should be filtered earlier */
+ GST_ELEMENT_ERROR (filter, STREAM, NOT_IMPLEMENTED, (NULL),
+ ("The subclass does not have a process method"));
+ gst_buffer_unref (in);
+ return GST_FLOW_ERROR;
+ }
}
static gboolean
@@ -297,6 +399,7 @@
gst_segment_init (&filter->segment, GST_FORMAT_UNDEFINED);
filter->need_newsegment = TRUE;
+ filter->priv->next_seqnum = -1;
break;
case GST_EVENT_NEWSEGMENT:
{
@@ -316,6 +419,29 @@
gst_event_unref (event);
break;
}
+ case GST_EVENT_CUSTOM_DOWNSTREAM:
+ {
+ GstBaseRTPDepayloadClass *bclass;
+
+ bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
+
+ if (gst_event_has_name (event, "GstRTPPacketLost")) {
+ /* we get this event from the jitterbuffer when it considers a packet as
+ * being lost. We send it to our packet_lost vmethod. The default
+ * implementation will make time progress by pushing out a NEWSEGMENT
+ * update event. Subclasses can override and to one of the following:
+ * - Adjust timestamp/duration to something more accurate before
+ * calling the parent (default) packet_lost method.
+ * - do some more advanced error concealing on the already received
+ * (fragmented) packets.
+ * - ignore the packet lost.
+ */
+ if (bclass->packet_lost)
+ res = bclass->packet_lost (filter, event);
+ }
+ gst_event_unref (event);
+ break;
+ }
default:
/* pass other events forward */
res = gst_pad_push_event (filter->srcpad, event);
@@ -324,6 +450,28 @@
return res;
}
+static GstEvent *
+create_segment_event (GstBaseRTPDepayload * filter, gboolean update,
+ GstClockTime position)
+{
+ GstEvent *event;
+ GstClockTime stop;
+ GstBaseRTPDepayloadPrivate *priv;
+
+ priv = filter->priv;
+
+ if (priv->npt_stop != -1)
+ stop = priv->npt_stop - priv->npt_start;
+ else
+ stop = -1;
+
+ event = gst_event_new_new_segment_full (update, priv->play_speed,
+ priv->play_scale, GST_FORMAT_TIME, position, stop,
+ position + priv->npt_start);
+
+ return event;
+}
+
static GstFlowReturn
gst_base_rtp_depayload_push_full (GstBaseRTPDepayload * filter,
gboolean do_ts, guint32 rtptime, GstBuffer * out_buf)
@@ -337,7 +485,7 @@
/* set the caps if any */
srccaps = GST_PAD_CAPS (filter->srcpad);
- if (srccaps)
+ if (G_LIKELY (srccaps))
gst_buffer_set_caps (out_buf, srccaps);
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
@@ -346,7 +494,20 @@
if (bclass->set_gst_timestamp && do_ts)
bclass->set_gst_timestamp (filter, rtptime, out_buf);
- if (priv->discont) {
+ /* if this is the first buffer send a NEWSEGMENT */
+ if (G_UNLIKELY (filter->need_newsegment)) {
+ GstEvent *event;
+
+ event = create_segment_event (filter, FALSE, 0);
+
+ gst_pad_push_event (filter->srcpad, event);
+
+ filter->need_newsegment = FALSE;
+ GST_DEBUG_OBJECT (filter, "Pushed newsegment event on this first buffer");
+ }
+
+ if (G_UNLIKELY (priv->discont)) {
+ GST_LOG_OBJECT (filter, "Marking DISCONT on output buffer");
GST_BUFFER_FLAG_SET (out_buf, GST_BUFFER_FLAG_DISCONT);
priv->discont = FALSE;
}
@@ -355,8 +516,8 @@
GST_LOG_OBJECT (filter, "Pushing buffer size %d, timestamp %" GST_TIME_FORMAT,
GST_BUFFER_SIZE (out_buf),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (out_buf)));
+
ret = gst_pad_push (filter->srcpad, out_buf);
- GST_LOG_OBJECT (filter, "Pushed buffer: %s", gst_flow_get_name (ret));
return ret;
}
@@ -410,6 +571,38 @@
return gst_base_rtp_depayload_push_full (filter, FALSE, 0, out_buf);
}
+/* convert the PacketLost event form a jitterbuffer to a segment update.
+ * subclasses can override this. */
+static gboolean
+gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload * filter,
+ GstEvent * event)
+{
+ GstBaseRTPDepayloadPrivate *priv;
+ GstClockTime timestamp, duration, position;
+ GstEvent *sevent;
+ const GstStructure *s;
+
+ priv = filter->priv;
+
+ s = gst_event_get_structure (event);
+
+ /* first start by parsing the timestamp and duration */
+ timestamp = -1;
+ duration = -1;
+
+ gst_structure_get_clock_time (s, "timestamp", ×tamp);
+ gst_structure_get_clock_time (s, "duration", &duration);
+
+ position = timestamp;
+ if (duration != -1)
+ position += duration;
+
+ /* update the current segment with the elapsed time */
+ sevent = create_segment_event (filter, TRUE, position);
+
+ return gst_pad_push_event (filter->srcpad, sevent);
+}
+
static void
gst_base_rtp_depayload_set_gst_timestamp (GstBaseRTPDepayload * filter,
guint32 rtptime, GstBuffer * buf)
@@ -428,28 +621,6 @@
GST_BUFFER_TIMESTAMP (buf) = priv->timestamp;
if (!GST_CLOCK_TIME_IS_VALID (duration))
GST_BUFFER_DURATION (buf) = priv->duration;
-
- /* if this is the first buffer send a NEWSEGMENT */
- if (filter->need_newsegment) {
- GstEvent *event;
- GstClockTime stop, position;
-
- if (priv->npt_stop != -1)
- stop = priv->npt_stop - priv->npt_start;
- else
- stop = -1;
-
- position = priv->npt_start;
-
- event =
- gst_event_new_new_segment_full (FALSE, priv->play_speed,
- priv->play_scale, GST_FORMAT_TIME, 0, stop, position);
-
- gst_pad_push_event (filter->srcpad, event);
-
- filter->need_newsegment = FALSE;
- GST_DEBUG_OBJECT (filter, "Pushed newsegment event on this first buffer");
- }
}
static GstStateChangeReturn
@@ -472,6 +643,8 @@
priv->npt_stop = -1;
priv->play_speed = 1.0;
priv->play_scale = 1.0;
+ priv->next_seqnum = -1;
+ priv->negotiated = FALSE;
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/gstbasertpdepayload.h
--- a/gst_plugins_base/gst-libs/gst/rtp/gstbasertpdepayload.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtp/gstbasertpdepayload.h Wed Mar 24 18:04:17 2010 -0500
@@ -96,7 +96,7 @@
{
GstElementClass parent_class;
- /* virtuals */
+ /* virtuals, inform the subclass of the caps. */
gboolean (*set_caps) (GstBaseRTPDepayload *filter, GstCaps *caps);
/* non-pure function, default implementation in base class
@@ -104,17 +104,23 @@
GstFlowReturn (*add_to_queue) (GstBaseRTPDepayload *filter, GstBuffer *in);
/* pure virtual function, child must use this to process incoming
- * rtp packets. If the child returns a buffer, the timestamp of @in will be
- * applied to the result buffer and the buffer will be pushed. If this
- * function returns %NULL, nothing is pushed. */
+ * rtp packets. If the child returns a buffer without a valid timestamp,
+ * the timestamp of @in will be applied to the result buffer and the
+ * buffer will be pushed. If this function returns %NULL, nothing is
+ * pushed. */
GstBuffer * (*process) (GstBaseRTPDepayload *base, GstBuffer *in);
/* non-pure function used to convert from RTP timestamp to GST timestamp
* this function is used by the child class before gst_pad_pushing */
void (*set_gst_timestamp) (GstBaseRTPDepayload *filter, guint32 timestamp, GstBuffer *buf);
+ /* non-pure function used to to signal the depayloader about packet loss. the
+ * timestamp and duration are the estimated values of the lost packet.
+ * The default implementation of this message pushes a segment update. */
+ gboolean (*packet_lost) (GstBaseRTPDepayload *filter, GstEvent *event);
+
/*< private >*/
- gpointer _gst_reserved[GST_PADDING];
+ gpointer _gst_reserved[GST_PADDING-1];
};
#ifdef __SYMBIAN32__
IMPORT_C
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/gstbasertppayload.c
--- a/gst_plugins_base/gst-libs/gst/rtp/gstbasertppayload.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtp/gstbasertppayload.c Wed Mar 24 18:04:17 2010 -0500
@@ -45,8 +45,6 @@
gboolean seqnum_offset_random;
gboolean ssrc_random;
guint16 next_seqnum;
-
- GstClockTime rt_base;
};
/* BaseRTPPayload signals and args */
@@ -90,8 +88,8 @@
gpointer g_class);
static void gst_basertppayload_finalize (GObject * object);
-static gboolean gst_basertppayload_setcaps (GstPad * pad, GstCaps * caps);
-static GstCaps *gst_basertppayload_getcaps (GstPad * pad);
+static gboolean gst_basertppayload_sink_setcaps (GstPad * pad, GstCaps * caps);
+static GstCaps *gst_basertppayload_sink_getcaps (GstPad * pad);
static gboolean gst_basertppayload_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_basertppayload_chain (GstPad * pad,
GstBuffer * buffer);
@@ -163,28 +161,31 @@
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MTU,
g_param_spec_uint ("mtu", "MTU",
"Maximum size of one packet",
- 28, G_MAXUINT, DEFAULT_MTU, G_PARAM_READWRITE));
+ 28, G_MAXUINT, DEFAULT_MTU,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PT,
g_param_spec_uint ("pt", "payload type",
- "The payload type of the packets",
- 0, 0x80, DEFAULT_PT, G_PARAM_READWRITE));
+ "The payload type of the packets", 0, 0x80, DEFAULT_PT,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SSRC,
g_param_spec_uint ("ssrc", "SSRC",
- "The SSRC of the packets (default == random)",
- 0, G_MAXUINT32, DEFAULT_SSRC, G_PARAM_READWRITE));
+ "The SSRC of the packets (default == random)", 0, G_MAXUINT32,
+ DEFAULT_SSRC, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass),
PROP_TIMESTAMP_OFFSET, g_param_spec_uint ("timestamp-offset",
"Timestamp Offset",
"Offset to add to all outgoing timestamps (default = random)", 0,
- G_MAXUINT32, DEFAULT_TIMESTAMP_OFFSET, G_PARAM_READWRITE));
+ G_MAXUINT32, DEFAULT_TIMESTAMP_OFFSET,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SEQNUM_OFFSET,
g_param_spec_int ("seqnum-offset", "Sequence number Offset",
"Offset to add to all outgoing seqnum (-1 = random)", -1, G_MAXUINT16,
- DEFAULT_SEQNUM_OFFSET, G_PARAM_READWRITE));
+ DEFAULT_SEQNUM_OFFSET, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_PTIME,
g_param_spec_int64 ("max-ptime", "Max packet time",
"Maximum duration of the packet data in ns (-1 = unlimited up to MTU)",
- -1, G_MAXINT64, DEFAULT_MAX_PTIME, G_PARAM_READWRITE));
+ -1, G_MAXINT64, DEFAULT_MAX_PTIME,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* GstBaseRTPAudioPayload:min-ptime:
*
@@ -195,16 +196,17 @@
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MIN_PTIME,
g_param_spec_int64 ("min-ptime", "Min packet time",
"Minimum duration of the packet data in ns (can't go above MTU)",
- 0, G_MAXINT64, DEFAULT_MIN_PTIME, G_PARAM_READWRITE));
+ 0, G_MAXINT64, DEFAULT_MIN_PTIME,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TIMESTAMP,
g_param_spec_uint ("timestamp", "Timestamp",
"The RTP timestamp of the last processed packet",
- 0, G_MAXUINT32, 0, G_PARAM_READABLE));
+ 0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SEQNUM,
g_param_spec_uint ("seqnum", "Sequence number",
"The RTP sequence number of the last processed packet",
- 0, G_MAXUINT16, 0, G_PARAM_READABLE));
+ 0, G_MAXUINT16, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
gstelement_class->change_state = gst_basertppayload_change_state;
@@ -234,9 +236,9 @@
basertppayload->sinkpad = gst_pad_new_from_template (templ, "sink");
gst_pad_set_setcaps_function (basertppayload->sinkpad,
- gst_basertppayload_setcaps);
+ gst_basertppayload_sink_setcaps);
gst_pad_set_getcaps_function (basertppayload->sinkpad,
- gst_basertppayload_getcaps);
+ gst_basertppayload_sink_getcaps);
gst_pad_set_event_function (basertppayload->sinkpad,
gst_basertppayload_event);
gst_pad_set_chain_function (basertppayload->sinkpad,
@@ -288,7 +290,7 @@
}
static gboolean
-gst_basertppayload_setcaps (GstPad * pad, GstCaps * caps)
+gst_basertppayload_sink_setcaps (GstPad * pad, GstCaps * caps)
{
GstBaseRTPPayload *basertppayload;
GstBaseRTPPayloadClass *basertppayload_class;
@@ -307,7 +309,7 @@
}
static GstCaps *
-gst_basertppayload_getcaps (GstPad * pad)
+gst_basertppayload_sink_getcaps (GstPad * pad)
{
GstBaseRTPPayload *basertppayload;
GstBaseRTPPayloadClass *basertppayload_class;
@@ -477,8 +479,9 @@
...)
{
GstCaps *srccaps, *peercaps;
+ gboolean res;
- /* fill in the defaults, there properties cannot be negotiated. */
+ /* fill in the defaults, their properties cannot be negotiated. */
srccaps = gst_caps_new_simple ("application/x-rtp",
"media", G_TYPE_STRING, payload->media,
"clock-rate", G_TYPE_INT, payload->clock_rate,
@@ -591,10 +594,10 @@
GST_DEBUG_OBJECT (payload, "with peer caps: %" GST_PTR_FORMAT, srccaps);
}
- gst_pad_set_caps (GST_BASE_RTP_PAYLOAD_SRCPAD (payload), srccaps);
+ res = gst_pad_set_caps (GST_BASE_RTP_PAYLOAD_SRCPAD (payload), srccaps);
gst_caps_unref (srccaps);
- return TRUE;
+ return res;
}
/**
@@ -603,7 +606,7 @@
* @size: the size of the packet
* @duration: the duration of the packet
*
- * Check if the packet with @size and @duration would exceed the configure
+ * Check if the packet with @size and @duration would exceed the configured
* maximum size.
*
* Returns: %TRUE if the packet of @size and @duration would exceed the
@@ -626,6 +629,155 @@
return FALSE;
}
+typedef struct
+{
+ GstBaseRTPPayload *payload;
+ guint32 ssrc;
+ guint16 seqnum;
+ guint8 pt;
+ GstCaps *caps;
+ GstClockTime timestamp;
+ guint32 rtptime;
+} HeaderData;
+
+static GstBufferListItem
+find_timestamp (GstBuffer ** buffer, guint group, guint idx, HeaderData * data)
+{
+ data->timestamp = GST_BUFFER_TIMESTAMP (*buffer);
+
+ /* stop when we find a timestamp */
+ if (data->timestamp != -1)
+ return GST_BUFFER_LIST_END;
+ else
+ return GST_BUFFER_LIST_CONTINUE;
+}
+
+static GstBufferListItem
+set_headers (GstBuffer ** buffer, guint group, guint idx, HeaderData * data)
+{
+ gst_rtp_buffer_set_ssrc (*buffer, data->ssrc);
+ gst_rtp_buffer_set_payload_type (*buffer, data->pt);
+ gst_rtp_buffer_set_seq (*buffer, data->seqnum);
+ gst_rtp_buffer_set_timestamp (*buffer, data->rtptime);
+ gst_buffer_set_caps (*buffer, data->caps);
+ data->seqnum++;
+
+ return GST_BUFFER_LIST_SKIP_GROUP;
+}
+
+/* Updates the SSRC, payload type, seqnum and timestamp of the RTP buffer
+ * before the buffer is pushed. */
+static GstFlowReturn
+gst_basertppayload_prepare_push (GstBaseRTPPayload * payload,
+ gpointer obj, gboolean is_list)
+{
+ GstBaseRTPPayloadPrivate *priv;
+ HeaderData data;
+
+ if (payload->clock_rate == 0)
+ goto no_rate;
+
+ priv = payload->priv;
+
+ /* update first, so that the property is set to the last
+ * seqnum pushed */
+ payload->seqnum = priv->next_seqnum;
+
+ /* fill in the fields we want to set on all headers */
+ data.payload = payload;
+ data.seqnum = payload->seqnum;
+ data.ssrc = payload->current_ssrc;
+ data.pt = payload->pt;
+ data.caps = GST_PAD_CAPS (payload->srcpad);
+ data.timestamp = -1;
+
+ /* find the first buffer with a timestamp */
+ if (is_list) {
+ gst_buffer_list_foreach (GST_BUFFER_LIST_CAST (obj),
+ (GstBufferListFunc) find_timestamp, &data);
+ } else {
+ data.timestamp = GST_BUFFER_TIMESTAMP (GST_BUFFER_CAST (obj));
+ }
+
+ /* convert to RTP time */
+ if (GST_CLOCK_TIME_IS_VALID (data.timestamp)) {
+ gint64 rtime;
+
+ rtime = gst_segment_to_running_time (&payload->segment, GST_FORMAT_TIME,
+ data.timestamp);
+
+ rtime = gst_util_uint64_scale_int (rtime, payload->clock_rate, GST_SECOND);
+
+ /* add running_time in clock-rate units to the base timestamp */
+ data.rtptime = payload->ts_base + rtime;
+ } else {
+ /* no timestamp to convert, take previous timestamp */
+ data.rtptime = payload->timestamp;
+ }
+
+ /* set ssrc, payload type, seq number, caps and rtptime */
+ if (is_list) {
+ gst_buffer_list_foreach (GST_BUFFER_LIST_CAST (obj),
+ (GstBufferListFunc) set_headers, &data);
+ } else {
+ GstBuffer *buf = GST_BUFFER_CAST (obj);
+ set_headers (&buf, 0, 0, &data);
+ }
+
+ priv->next_seqnum = data.seqnum;
+ payload->timestamp = data.rtptime;
+
+ GST_LOG_OBJECT (payload,
+ "Preparing to push packet with size %d, seq=%d, rtptime=%u, timestamp %"
+ GST_TIME_FORMAT, (is_list) ? -1 :
+ GST_BUFFER_SIZE (GST_BUFFER (obj)), payload->seqnum, data.rtptime,
+ GST_TIME_ARGS (data.timestamp));
+
+ return GST_FLOW_OK;
+
+ /* ERRORS */
+no_rate:
+ {
+ GST_ELEMENT_ERROR (payload, STREAM, NOT_IMPLEMENTED, (NULL),
+ ("subclass did not specify clock-rate"));
+ return GST_FLOW_ERROR;
+ }
+}
+
+/**
+ * gst_basertppayload_push_list:
+ * @payload: a #GstBaseRTPPayload
+ * @list: a #GstBufferList
+ *
+ * Push @list to the peer element of the payloader. The SSRC, payload type,
+ * seqnum and timestamp of the RTP buffer will be updated first.
+ *
+ * This function takes ownership of @list.
+ *
+ * Returns: a #GstFlowReturn.
+ *
+ * Since: 0.10.24
+ */
+
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstFlowReturn
+gst_basertppayload_push_list (GstBaseRTPPayload * payload, GstBufferList * list)
+{
+ GstFlowReturn res;
+
+ res = gst_basertppayload_prepare_push (payload, list, TRUE);
+
+ if (G_LIKELY (res == GST_FLOW_OK))
+ res = gst_pad_push_list (payload->srcpad, list);
+ else
+ gst_buffer_list_unref (list);
+
+ return res;
+}
+
/**
* gst_basertppayload_push:
* @payload: a #GstBaseRTPPayload
@@ -646,78 +798,15 @@
gst_basertppayload_push (GstBaseRTPPayload * payload, GstBuffer * buffer)
{
GstFlowReturn res;
- GstClockTime timestamp;
- guint32 rtptime;
- GstBaseRTPPayloadPrivate *priv;
- if (payload->clock_rate == 0)
- goto no_rate;
-
- priv = payload->priv;
-
- gst_rtp_buffer_set_ssrc (buffer, payload->current_ssrc);
-
- gst_rtp_buffer_set_payload_type (buffer, payload->pt);
-
- /* update first, so that the property is set to the last
- * seqnum pushed */
- payload->seqnum = priv->next_seqnum;
- gst_rtp_buffer_set_seq (buffer, payload->seqnum);
-
- /* can wrap around, which is perfectly fine */
- priv->next_seqnum++;
-
- /* add our random offset to the timestamp */
- rtptime = payload->ts_base;
-
- timestamp = GST_BUFFER_TIMESTAMP (buffer);
- if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
- gint64 rtime;
-
- rtime = gst_segment_to_running_time (&payload->segment, GST_FORMAT_TIME,
- timestamp);
+ res = gst_basertppayload_prepare_push (payload, buffer, FALSE);
- /* take first timestamp as base, we want to calculate the RTP timestamp
- * starting from the ts_base */
- if (priv->rt_base == -1) {
- priv->rt_base = rtime;
- GST_LOG_OBJECT (payload, "first timestamp %" GST_TIME_FORMAT,
- GST_TIME_ARGS (rtime));
- }
- rtime -= priv->rt_base;
-
- rtime = gst_util_uint64_scale_int (rtime, payload->clock_rate, GST_SECOND);
-
- /* add running_time in clock-rate units to the base timestamp */
- rtptime += rtime;
- } else {
- /* no timestamp to convert, take previous timestamp */
- rtptime = payload->timestamp;
- }
- gst_rtp_buffer_set_timestamp (buffer, rtptime);
-
- payload->timestamp = rtptime;
-
- /* set caps */
- gst_buffer_set_caps (buffer, GST_PAD_CAPS (payload->srcpad));
-
- GST_LOG_OBJECT (payload,
- "Pushing packet size %d, seq=%d, rtptime=%u, timestamp %" GST_TIME_FORMAT,
- GST_BUFFER_SIZE (buffer), payload->seqnum, rtptime,
- GST_TIME_ARGS (timestamp));
-
- res = gst_pad_push (payload->srcpad, buffer);
+ if (G_LIKELY (res == GST_FLOW_OK))
+ res = gst_pad_push (payload->srcpad, buffer);
+ else
+ gst_buffer_unref (buffer);
return res;
-
- /* ERRORS */
-no_rate:
- {
- GST_ELEMENT_ERROR (payload, STREAM, NOT_IMPLEMENTED, (NULL),
- ("subclass did not specify clock-rate"));
- gst_buffer_unref (buffer);
- return GST_FLOW_ERROR;
- }
}
static void
@@ -843,6 +932,7 @@
else
basertppayload->seqnum_base = basertppayload->seqnum_offset;
priv->next_seqnum = basertppayload->seqnum_base;
+ basertppayload->seqnum = basertppayload->seqnum_base;
if (priv->ssrc_random)
basertppayload->current_ssrc = g_rand_int (basertppayload->ssrc_rand);
@@ -853,8 +943,7 @@
basertppayload->ts_base = g_rand_int (basertppayload->ts_rand);
else
basertppayload->ts_base = basertppayload->ts_offset;
-
- priv->rt_base = -1;
+ basertppayload->timestamp = basertppayload->ts_base;
break;
default:
break;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/gstbasertppayload.h
--- a/gst_plugins_base/gst-libs/gst/rtp/gstbasertppayload.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtp/gstbasertppayload.h Wed Mar 24 18:04:17 2010 -0500
@@ -118,7 +118,7 @@
/* receive caps on the sink pad, configure the payloader. */
gboolean (*set_caps) (GstBaseRTPPayload *payload, GstCaps *caps);
/* handle a buffer, perform 0 or more gst_basertppayload_push() on
- * the RTP buffers */
+ * the RTP buffers. This function takes ownership of the buffer. */
GstFlowReturn (*handle_buffer) (GstBaseRTPPayload *payload,
GstBuffer *buffer);
gboolean (*handle_event) (GstPad * pad, GstEvent * event);
@@ -162,8 +162,14 @@
GstFlowReturn gst_basertppayload_push (GstBaseRTPPayload *payload,
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
GstBuffer *buffer);
+GstFlowReturn gst_basertppayload_push_list (GstBaseRTPPayload *payload,
+ GstBufferList *list);
+
G_END_DECLS
#endif /* __GST_BASE_RTP_PAYLOAD_H__ */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/gstrtcpbuffer.c
--- a/gst_plugins_base/gst-libs/gst/rtp/gstrtcpbuffer.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtp/gstrtcpbuffer.c Wed Mar 24 18:04:17 2010 -0500
@@ -36,14 +36,18 @@
*
* An RTCP buffer consists of 1 or more #GstRTCPPacket structures that you can
* retrieve with gst_rtcp_buffer_get_first_packet(). #GstRTCPPacket acts as a pointer
- * into the RTCP buffer; you can move to the next packet with
+ * into the RTCP buffer;
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+ you can move to the next packet with
* gst_rtcp_packet_move_to_next().
*
*
*
- * Since: 0.10.13
+ * Last reviewed on 2007-03-26 (0.10.13)
*
- * Last reviewed on 2007-03-26 (0.10.13)
+ * Since: 0.10.13
*/
#include
@@ -405,7 +409,8 @@
*/
#ifdef __SYMBIAN32__
EXPORT_C
-#endif
+#endif
+
gboolean
gst_rtcp_packet_move_to_next (GstRTCPPacket * packet)
{
@@ -488,6 +493,11 @@
case GST_RTCP_TYPE_APP:
len = 12;
break;
+ case GST_RTCP_TYPE_RTPFB:
+ len = 12;
+ break;
+ case GST_RTCP_TYPE_PSFB:
+ len = 12;
default:
goto unknown_type;
}
@@ -525,21 +535,38 @@
* gst_rtcp_packet_remove:
* @packet: a #GstRTCPPacket
*
- * Removes the packet pointed to by @packet.
+ * Removes the packet pointed to by @packet and moves pointer to the next one
*
- * Note: Not implemented.
+ * Returns: TRUE if @packet is pointing to a valid packet after calling this
+ * function.
*/
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-void
+gboolean
gst_rtcp_packet_remove (GstRTCPPacket * packet)
{
- g_return_if_fail (packet != NULL);
- g_return_if_fail (packet->type != GST_RTCP_TYPE_INVALID);
+ gboolean ret = FALSE;
+ guint offset = 0;
+
+ g_return_val_if_fail (packet != NULL, FALSE);
+ g_return_val_if_fail (packet->type != GST_RTCP_TYPE_INVALID, FALSE);
+
+ /* The next packet starts at offset + length + 4 (the header) */
+ offset = packet->offset + (packet->length << 2) + 4;
- g_warning ("not implemented");
+ /* Overwrite this packet with the rest of the data */
+ memmove (GST_BUFFER_DATA (packet->buffer) + packet->offset,
+ GST_BUFFER_DATA (packet->buffer) + offset,
+ GST_BUFFER_SIZE (packet->buffer) - offset);
+
+ /* try to read next header */
+ ret = read_packet_header (packet);
+ if (!ret)
+ packet->type = GST_RTCP_TYPE_INVALID;
+
+ return ret;
}
/**
@@ -569,7 +596,8 @@
*
* Get the packet type of the packet pointed to by @packet.
*
- * Returns: The packet type.
+ * Returns: The packet type or GST_RTCP_TYPE_INVALID when @packet is not
+ * pointing to a valid packet.
*/
#ifdef __SYMBIAN32__
EXPORT_C
@@ -579,8 +607,6 @@
gst_rtcp_packet_get_type (GstRTCPPacket * packet)
{
g_return_val_if_fail (packet != NULL, GST_RTCP_TYPE_INVALID);
- g_return_val_if_fail (packet->type != GST_RTCP_TYPE_INVALID,
- GST_RTCP_TYPE_INVALID);
return packet->type;
}
@@ -1779,6 +1805,187 @@
}
/**
+ * gst_rtcp_packet_fb_get_sender_ssrc:
+ * @packet: a valid RTPFB or PSFB #GstRTCPPacket
+ *
+ * Get the sender SSRC field of the RTPFB or PSFB @packet.
+ *
+ * Returns: the sender SSRC.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+guint32
+gst_rtcp_packet_fb_get_sender_ssrc (GstRTCPPacket * packet)
+{
+ guint8 *data;
+ guint32 ssrc;
+
+ g_return_val_if_fail (packet != NULL, 0);
+ g_return_val_if_fail ((packet->type == GST_RTCP_TYPE_RTPFB ||
+ packet->type == GST_RTCP_TYPE_PSFB), 0);
+ g_return_val_if_fail (GST_IS_BUFFER (packet->buffer), 0);
+
+ data = GST_BUFFER_DATA (packet->buffer);
+
+ /* skip header */
+ data += packet->offset + 4;
+ ssrc = GST_READ_UINT32_BE (data);
+
+ return ssrc;
+}
+
+/**
+ * gst_rtcp_packet_fb_set_sender_ssrc:
+ * @packet: a valid RTPFB or PSFB #GstRTCPPacket
+ * @ssrc: a sender SSRC
+ *
+ * Set the sender SSRC field of the RTPFB or PSFB @packet.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_rtcp_packet_fb_set_sender_ssrc (GstRTCPPacket * packet, guint32 ssrc)
+{
+ guint8 *data;
+
+ g_return_if_fail (packet != NULL);
+ g_return_if_fail (packet->type == GST_RTCP_TYPE_RTPFB ||
+ packet->type == GST_RTCP_TYPE_PSFB);
+ g_return_if_fail (GST_IS_BUFFER (packet->buffer));
+
+ data = GST_BUFFER_DATA (packet->buffer);
+
+ /* skip header */
+ data += packet->offset + 4;
+ GST_WRITE_UINT32_BE (data, ssrc);
+}
+
+/**
+ * gst_rtcp_packet_fb_get_media_ssrc:
+ * @packet: a valid RTPFB or PSFB #GstRTCPPacket
+ *
+ * Get the media SSRC field of the RTPFB or PSFB @packet.
+ *
+ * Returns: the media SSRC.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+guint32
+gst_rtcp_packet_fb_get_media_ssrc (GstRTCPPacket * packet)
+{
+ guint8 *data;
+ guint32 ssrc;
+
+ g_return_val_if_fail (packet != NULL, 0);
+ g_return_val_if_fail ((packet->type == GST_RTCP_TYPE_RTPFB ||
+ packet->type == GST_RTCP_TYPE_PSFB), 0);
+ g_return_val_if_fail (GST_IS_BUFFER (packet->buffer), 0);
+
+ data = GST_BUFFER_DATA (packet->buffer);
+
+ /* skip header and sender ssrc */
+ data += packet->offset + 8;
+ ssrc = GST_READ_UINT32_BE (data);
+
+ return ssrc;
+}
+
+/**
+ * gst_rtcp_packet_fb_set_media_ssrc:
+ * @packet: a valid RTPFB or PSFB #GstRTCPPacket
+ * @ssrc: a media SSRC
+ *
+ * Set the media SSRC field of the RTPFB or PSFB @packet.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_rtcp_packet_fb_set_media_ssrc (GstRTCPPacket * packet, guint32 ssrc)
+{
+ guint8 *data;
+
+ g_return_if_fail (packet != NULL);
+ g_return_if_fail (packet->type == GST_RTCP_TYPE_RTPFB ||
+ packet->type == GST_RTCP_TYPE_PSFB);
+ g_return_if_fail (GST_IS_BUFFER (packet->buffer));
+
+ data = GST_BUFFER_DATA (packet->buffer);
+
+ /* skip header and sender ssrc */
+ data += packet->offset + 8;
+ GST_WRITE_UINT32_BE (data, ssrc);
+}
+
+/**
+ * gst_rtcp_packet_fb_get_type:
+ * @packet: a valid RTPFB or PSFB #GstRTCPPacket
+ *
+ * Get the feedback message type of the FB @packet.
+ *
+ * Returns: The feedback message type.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstRTCPFBType
+gst_rtcp_packet_fb_get_type (GstRTCPPacket * packet)
+{
+ g_return_val_if_fail (packet != NULL, GST_RTCP_FB_TYPE_INVALID);
+ g_return_val_if_fail (packet->type == GST_RTCP_TYPE_RTPFB ||
+ packet->type == GST_RTCP_TYPE_PSFB, GST_RTCP_FB_TYPE_INVALID);
+
+ return packet->count;
+}
+
+/**
+ * gst_rtcp_packet_fb_set_type:
+ * @packet: a valid RTPFB or PSFB #GstRTCPPacket
+ * @type: the #GstRTCPFBType to set
+ *
+ * Set the feedback message type of the FB @packet.
+ *
+ * Since: 0.10.23
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_rtcp_packet_fb_set_type (GstRTCPPacket * packet, GstRTCPFBType type)
+{
+ guint8 *data;
+
+ g_return_if_fail (packet != NULL);
+ g_return_if_fail (packet->type == GST_RTCP_TYPE_RTPFB ||
+ packet->type == GST_RTCP_TYPE_PSFB);
+ g_return_if_fail (GST_IS_BUFFER (packet->buffer));
+
+ data = GST_BUFFER_DATA (packet->buffer);
+
+ data[packet->offset] = (data[packet->offset] & 0xe0) | type;
+ packet->count = type;
+}
+
+/**
* gst_rtcp_ntp_to_unix:
* @ntptime: an NTP timestamp
*
@@ -1819,7 +2026,7 @@
* bits, the fractional seconds. The resulting value can be used as an ntptime
* for constructing SR RTCP packets.
*
- * Returns: the NTP time for @gsttime.
+ * Returns: the NTP time for @unixtime.
*/
#ifdef __SYMBIAN32__
EXPORT_C
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/gstrtcpbuffer.h
--- a/gst_plugins_base/gst-libs/gst/rtp/gstrtcpbuffer.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtp/gstrtcpbuffer.h Wed Mar 24 18:04:17 2010 -0500
@@ -42,6 +42,8 @@
* @GST_RTCP_TYPE_SDES: Source description
* @GST_RTCP_TYPE_BYE: Goodbye
* @GST_RTCP_TYPE_APP: Application defined
+ * @GST_RTCP_TYPE_RTPFB: Transport layer feedback. Since: 0.10.23
+ * @GST_RTCP_TYPE_PSFB: Payload-specific feedback. Since: 0.10.23
*
* Different RTCP packet types.
*/
@@ -52,9 +54,37 @@
GST_RTCP_TYPE_RR = 201,
GST_RTCP_TYPE_SDES = 202,
GST_RTCP_TYPE_BYE = 203,
- GST_RTCP_TYPE_APP = 204
+ GST_RTCP_TYPE_APP = 204,
+ GST_RTCP_TYPE_RTPFB = 205,
+ GST_RTCP_TYPE_PSFB = 206
} GstRTCPType;
+/**
+ * GstRTCPFBType:
+ * @GST_RTCP_FB_TYPE_INVALID: Invalid type
+ * @GST_RTCP_RTPFB_TYPE_NACK: Generic NACK
+ * @GST_RTCP_PSFB_TYPE_PLI: Picture Loss Indication
+ * @GST_RTCP_PSFB_TYPE_SLI: Slice Loss Indication
+ * @GST_RTCP_PSFB_TYPE_RPSI: Reference Picture Selection Indication
+ * @GST_RTCP_PSFB_TYPE_AFB: Application layer Feedback
+ *
+ * Different types of feedback messages.
+ *
+ * Since: 0.10.23
+ */
+typedef enum
+{
+ /* generic */
+ GST_RTCP_FB_TYPE_INVALID = 0,
+ /* RTPFB types */
+ GST_RTCP_RTPFB_TYPE_NACK = 1,
+ /* PSFB types */
+ GST_RTCP_PSFB_TYPE_PLI = 1,
+ GST_RTCP_PSFB_TYPE_SLI = 2,
+ GST_RTCP_PSFB_TYPE_RPSI = 3,
+ GST_RTCP_PSFB_TYPE_AFB = 15
+} GstRTCPFBType;
+
/**
* GstRTCPSDESType:
* @GST_RTCP_SDES_INVALID: Invalid SDES entry
@@ -213,7 +243,7 @@
IMPORT_C
#endif
-void gst_rtcp_packet_remove (GstRTCPPacket *packet);
+gboolean gst_rtcp_packet_remove (GstRTCPPacket *packet);
/* working with packets */
#ifdef __SYMBIAN32__
@@ -392,6 +422,38 @@
gboolean gst_rtcp_packet_bye_set_reason (GstRTCPPacket *packet, const gchar *reason);
+/* feedback packets */
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+guint32 gst_rtcp_packet_fb_get_sender_ssrc (GstRTCPPacket *packet);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+void gst_rtcp_packet_fb_set_sender_ssrc (GstRTCPPacket *packet, guint32 ssrc);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+guint32 gst_rtcp_packet_fb_get_media_ssrc (GstRTCPPacket *packet);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+void gst_rtcp_packet_fb_set_media_ssrc (GstRTCPPacket *packet, guint32 ssrc);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+GstRTCPFBType gst_rtcp_packet_fb_get_type (GstRTCPPacket *packet);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+void gst_rtcp_packet_fb_set_type (GstRTCPPacket *packet, GstRTCPFBType type);
+
/* helper functions */
#ifdef __SYMBIAN32__
IMPORT_C
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/gstrtpbuffer.c
--- a/gst_plugins_base/gst-libs/gst/rtp/gstrtpbuffer.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtp/gstrtpbuffer.c Wed Mar 24 18:04:17 2010 -0500
@@ -69,20 +69,19 @@
guint8 csrclist[4]; /* optional CSRC list, 32 bits each */
} GstRTPHeader;
-#define GST_RTP_HEADER_VERSION(buf) (((GstRTPHeader *)(GST_BUFFER_DATA (buf)))->version)
-#define GST_RTP_HEADER_PADDING(buf) (((GstRTPHeader *)(GST_BUFFER_DATA (buf)))->padding)
-#define GST_RTP_HEADER_EXTENSION(buf) (((GstRTPHeader *)(GST_BUFFER_DATA (buf)))->extension)
-#define GST_RTP_HEADER_CSRC_COUNT(buf) (((GstRTPHeader *)(GST_BUFFER_DATA (buf)))->csrc_count)
-#define GST_RTP_HEADER_MARKER(buf) (((GstRTPHeader *)(GST_BUFFER_DATA (buf)))->marker)
-#define GST_RTP_HEADER_PAYLOAD_TYPE(buf)(((GstRTPHeader *)(GST_BUFFER_DATA (buf)))->payload_type)
-#define GST_RTP_HEADER_SEQ(buf) (((GstRTPHeader *)(GST_BUFFER_DATA (buf)))->seq)
-#define GST_RTP_HEADER_TIMESTAMP(buf) (((GstRTPHeader *)(GST_BUFFER_DATA (buf)))->timestamp)
-#define GST_RTP_HEADER_SSRC(buf) (((GstRTPHeader *)(GST_BUFFER_DATA (buf)))->ssrc)
-#define GST_RTP_HEADER_CSRC_LIST_OFFSET(buf,i) \
- GST_BUFFER_DATA (buf) + \
- G_STRUCT_OFFSET(GstRTPHeader, csrclist) + \
+#define GST_RTP_HEADER_VERSION(data) (((GstRTPHeader *)(data))->version)
+#define GST_RTP_HEADER_PADDING(data) (((GstRTPHeader *)(data))->padding)
+#define GST_RTP_HEADER_EXTENSION(data) (((GstRTPHeader *)(data))->extension)
+#define GST_RTP_HEADER_CSRC_COUNT(data) (((GstRTPHeader *)(data))->csrc_count)
+#define GST_RTP_HEADER_MARKER(data) (((GstRTPHeader *)(data))->marker)
+#define GST_RTP_HEADER_PAYLOAD_TYPE(data) (((GstRTPHeader *)(data))->payload_type)
+#define GST_RTP_HEADER_SEQ(data) (((GstRTPHeader *)(data))->seq)
+#define GST_RTP_HEADER_TIMESTAMP(data) (((GstRTPHeader *)(data))->timestamp)
+#define GST_RTP_HEADER_SSRC(data) (((GstRTPHeader *)(data))->ssrc)
+#define GST_RTP_HEADER_CSRC_LIST_OFFSET(data,i) \
+ data + G_STRUCT_OFFSET(GstRTPHeader, csrclist) + \
((i) * sizeof(guint32))
-#define GST_RTP_HEADER_CSRC_SIZE(buf) (GST_RTP_HEADER_CSRC_COUNT(buf) * sizeof (guint32))
+#define GST_RTP_HEADER_CSRC_SIZE(data) (GST_RTP_HEADER_CSRC_COUNT(data) * sizeof (guint32))
/**
* gst_rtp_buffer_allocate_data:
@@ -105,6 +104,7 @@
guint8 pad_len, guint8 csrc_count)
{
guint len;
+ guint8 *data;
g_return_if_fail (csrc_count <= 15);
g_return_if_fail (GST_IS_BUFFER (buffer));
@@ -112,22 +112,23 @@
len = GST_RTP_HEADER_LEN + csrc_count * sizeof (guint32)
+ payload_len + pad_len;
- GST_BUFFER_MALLOCDATA (buffer) = g_malloc (len);
- GST_BUFFER_DATA (buffer) = GST_BUFFER_MALLOCDATA (buffer);
+ data = g_malloc (len);
+ GST_BUFFER_MALLOCDATA (buffer) = data;
+ GST_BUFFER_DATA (buffer) = data;
GST_BUFFER_SIZE (buffer) = len;
/* fill in defaults */
- GST_RTP_HEADER_VERSION (buffer) = GST_RTP_VERSION;
- GST_RTP_HEADER_PADDING (buffer) = FALSE;
- GST_RTP_HEADER_EXTENSION (buffer) = FALSE;
- GST_RTP_HEADER_CSRC_COUNT (buffer) = csrc_count;
- memset (GST_RTP_HEADER_CSRC_LIST_OFFSET (buffer, 0), 0,
+ GST_RTP_HEADER_VERSION (data) = GST_RTP_VERSION;
+ GST_RTP_HEADER_PADDING (data) = FALSE;
+ GST_RTP_HEADER_EXTENSION (data) = FALSE;
+ GST_RTP_HEADER_CSRC_COUNT (data) = csrc_count;
+ memset (GST_RTP_HEADER_CSRC_LIST_OFFSET (data, 0), 0,
csrc_count * sizeof (guint32));
- GST_RTP_HEADER_MARKER (buffer) = FALSE;
- GST_RTP_HEADER_PAYLOAD_TYPE (buffer) = 0;
- GST_RTP_HEADER_SEQ (buffer) = 0;
- GST_RTP_HEADER_TIMESTAMP (buffer) = 0;
- GST_RTP_HEADER_SSRC (buffer) = 0;
+ GST_RTP_HEADER_MARKER (data) = FALSE;
+ GST_RTP_HEADER_PAYLOAD_TYPE (data) = 0;
+ GST_RTP_HEADER_SEQ (data) = 0;
+ GST_RTP_HEADER_TIMESTAMP (data) = 0;
+ GST_RTP_HEADER_SSRC (data) = 0;
}
/**
@@ -316,23 +317,18 @@
}
/**
- * gst_rtp_buffer_validate_data:
+ * validate_data:
* @data: the data to validate
* @len: the length of @data to validate
+ * @payload: the payload if @data represents the header only
+ * @payload_len: the len of the payload
*
- * Check if the @data and @size point to the data of a valid RTP packet.
- * This function checks the length, version and padding of the packet data.
- * Use this function to validate a packet before using the other functions in
- * this module.
+ * Checks if @data is a valid RTP packet.
*
- * Returns: TRUE if the data points to a valid RTP packet.
+ * Returns: TRUE if @data is a valid RTP packet
*/
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-gboolean
-gst_rtp_buffer_validate_data (guint8 * data, guint len)
+static gboolean
+validate_data (guint8 * data, guint len, guint8 * payload, guint payload_len)
{
guint8 padding;
guint8 csrc_count;
@@ -346,8 +342,8 @@
goto wrong_length;
/* check version */
- version = (data[0] & 0xc0) >> 6;
- if (G_UNLIKELY (version != GST_RTP_VERSION))
+ version = (data[0] & 0xc0);
+ if (G_UNLIKELY (version != (GST_RTP_VERSION << 6)))
goto wrong_version;
/* calc header length with csrc */
@@ -376,13 +372,17 @@
}
/* check for padding */
- if (data[0] & 0x20)
- padding = data[len - 1];
- else
+ if (data[0] & 0x20) {
+ if (payload)
+ padding = payload[payload_len - 1];
+ else
+ padding = data[len - 1];
+ } else {
padding = 0;
+ }
- /* check if padding not bigger than packet and header */
- if (G_UNLIKELY (len - header_len < padding))
+ /* check if padding and header not bigger than packet length */
+ if (G_UNLIKELY (len < padding + header_len))
goto wrong_padding;
return TRUE;
@@ -406,11 +406,35 @@
}
/**
+ * gst_rtp_buffer_validate_data:
+ * @data: the data to validate
+ * @len: the length of @data to validate
+ *
+ * Check if the @data and @size point to the data of a valid RTP packet.
+ * This function checks the length, version and padding of the packet data.
+ * Use this function to validate a packet before using the other functions in
+ * this module.
+ *
+ * Returns: TRUE if the data points to a valid RTP packet.
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_rtp_buffer_validate_data (guint8 * data, guint len)
+{
+ return validate_data (data, len, NULL, 0);
+}
+
+/**
* gst_rtp_buffer_validate:
* @buffer: the buffer to validate
*
* Check if the data pointed to by @buffer is a valid RTP packet using
- * gst_rtp_buffer_validate_data().
+ * validate_data().
+ * Use this function to validate a packet before using the other functions in
+ * this module.
*
* Returns: TRUE if @buffer is a valid RTP packet.
*/
@@ -429,7 +453,99 @@
data = GST_BUFFER_DATA (buffer);
len = GST_BUFFER_SIZE (buffer);
- return gst_rtp_buffer_validate_data (data, len);
+ return validate_data (data, len, NULL, 0);
+}
+
+/**
+ * gst_rtp_buffer_list_validate:
+ * @list: the buffer list to validate
+ *
+ * Check if all RTP packets in the @list are valid using validate_data().
+ * Use this function to validate an list before using the other functions in
+ * this module.
+ *
+ * Returns: TRUE if @list consists only of valid RTP packets.
+ *
+ * Since: 0.10.24
+ */
+
+ #ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_rtp_buffer_list_validate (GstBufferList * list)
+{
+ guint16 prev_seqnum = 0;
+ GstBufferListIterator *it;
+ guint i = 0;
+
+ g_return_val_if_fail (GST_IS_BUFFER_LIST (list), FALSE);
+
+ it = gst_buffer_list_iterate (list);
+ g_return_val_if_fail (it != NULL, FALSE);
+
+ /* iterate through all the RTP packets in the list */
+ while (gst_buffer_list_iterator_next_group (it)) {
+ GstBuffer *rtpbuf;
+ GstBuffer *paybuf;
+ guint8 *packet_header;
+ guint8 *packet_payload;
+ guint payload_size;
+ guint packet_size;
+
+ /* each group should consists of 2 buffers: one containing the RTP header
+ * and the other one the payload, FIXME, relax the requirement of only one
+ * payload buffer. */
+ if (gst_buffer_list_iterator_n_buffers (it) != 2)
+ goto invalid_list;
+
+ /* get the RTP header */
+ rtpbuf = gst_buffer_list_iterator_next (it);
+ packet_header = GST_BUFFER_DATA (rtpbuf);
+ if (packet_header == NULL)
+ goto invalid_list;
+
+ /* get the payload */
+ paybuf = gst_buffer_list_iterator_next (it);
+ packet_payload = GST_BUFFER_DATA (paybuf);
+ if (packet_payload == NULL) {
+ goto invalid_list;
+ }
+ payload_size = GST_BUFFER_SIZE (paybuf);
+ if (payload_size == 0) {
+ goto invalid_list;
+ }
+
+ /* the size of the RTP packet within the current group */
+ packet_size = GST_BUFFER_SIZE (rtpbuf) + payload_size;
+
+ /* check the sequence number */
+ if (G_UNLIKELY (i == 0)) {
+ prev_seqnum = g_ntohs (GST_RTP_HEADER_SEQ (packet_header));
+ i++;
+ } else {
+ if (++prev_seqnum != g_ntohs (GST_RTP_HEADER_SEQ (packet_header)))
+ goto invalid_list;
+ }
+
+ /* validate packet */
+ if (!validate_data (packet_header, packet_size, packet_payload,
+ payload_size)) {
+ goto invalid_list;
+ }
+ }
+
+ gst_buffer_list_iterator_free (it);
+
+ return TRUE;
+
+ /* ERRORS */
+invalid_list:
+ {
+ gst_buffer_list_iterator_free (it);
+ return FALSE;
+ }
}
/**
@@ -448,22 +564,20 @@
gst_rtp_buffer_set_packet_len (GstBuffer * buffer, guint len)
{
guint oldlen;
-
- g_return_if_fail (GST_IS_BUFFER (buffer));
+ guint8 *data;
oldlen = GST_BUFFER_SIZE (buffer);
+ data = GST_BUFFER_DATA (buffer);
if (oldlen < len) {
- guint8 *newdata;
-
- newdata = g_realloc (GST_BUFFER_MALLOCDATA (buffer), len);
- GST_BUFFER_MALLOCDATA (buffer) = newdata;
- GST_BUFFER_DATA (buffer) = newdata;
+ data = g_realloc (GST_BUFFER_MALLOCDATA (buffer), len);
+ GST_BUFFER_MALLOCDATA (buffer) = data;
+ GST_BUFFER_DATA (buffer) = data;
}
GST_BUFFER_SIZE (buffer) = len;
/* remove any padding */
- GST_RTP_HEADER_PADDING (buffer) = FALSE;
+ GST_RTP_HEADER_PADDING (data) = FALSE;
}
/**
@@ -481,8 +595,6 @@
guint
gst_rtp_buffer_get_packet_len (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
-
return GST_BUFFER_SIZE (buffer);
}
@@ -503,12 +615,13 @@
gst_rtp_buffer_get_header_len (GstBuffer * buffer)
{
guint len;
+ guint8 *data;
- g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
+ data = GST_BUFFER_DATA (buffer);
- len = GST_RTP_HEADER_LEN + GST_RTP_HEADER_CSRC_SIZE (buffer);
- if (GST_RTP_HEADER_EXTENSION (buffer))
- len += GST_READ_UINT16_BE (GST_BUFFER_DATA (buffer) + len + 2) * 4 + 4;
+ len = GST_RTP_HEADER_LEN + GST_RTP_HEADER_CSRC_SIZE (data);
+ if (GST_RTP_HEADER_EXTENSION (data))
+ len += GST_READ_UINT16_BE (data + len + 2) * 4 + 4;
return len;
}
@@ -528,10 +641,7 @@
guint8
gst_rtp_buffer_get_version (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, 0);
-
- return GST_RTP_HEADER_VERSION (buffer);
+ return GST_RTP_HEADER_VERSION (GST_BUFFER_DATA (buffer));
}
/**
@@ -548,11 +658,9 @@
void
gst_rtp_buffer_set_version (GstBuffer * buffer, guint8 version)
{
- g_return_if_fail (GST_IS_BUFFER (buffer));
g_return_if_fail (version < 0x04);
- g_return_if_fail (GST_BUFFER_DATA (buffer) != NULL);
- GST_RTP_HEADER_VERSION (buffer) = version;
+ GST_RTP_HEADER_VERSION (GST_BUFFER_DATA (buffer)) = version;
}
/**
@@ -570,10 +678,7 @@
gboolean
gst_rtp_buffer_get_padding (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, FALSE);
-
- return GST_RTP_HEADER_PADDING (buffer);
+ return GST_RTP_HEADER_PADDING (GST_BUFFER_DATA (buffer));
}
/**
@@ -590,10 +695,7 @@
void
gst_rtp_buffer_set_padding (GstBuffer * buffer, gboolean padding)
{
- g_return_if_fail (GST_IS_BUFFER (buffer));
- g_return_if_fail (GST_BUFFER_DATA (buffer) != NULL);
-
- GST_RTP_HEADER_PADDING (buffer) = padding;
+ GST_RTP_HEADER_PADDING (GST_BUFFER_DATA (buffer)) = padding;
}
/**
@@ -613,13 +715,14 @@
void
gst_rtp_buffer_pad_to (GstBuffer * buffer, guint len)
{
- g_return_if_fail (GST_IS_BUFFER (buffer));
- g_return_if_fail (GST_BUFFER_DATA (buffer) != NULL);
+ guint8 *data;
+
+ data = GST_BUFFER_DATA (buffer);
if (len > 0)
- GST_RTP_HEADER_PADDING (buffer) = TRUE;
+ GST_RTP_HEADER_PADDING (data) = TRUE;
else
- GST_RTP_HEADER_PADDING (buffer) = FALSE;
+ GST_RTP_HEADER_PADDING (data) = FALSE;
/* FIXME, set the padding byte at the end of the payload data */
}
@@ -639,10 +742,7 @@
gboolean
gst_rtp_buffer_get_extension (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, FALSE);
-
- return GST_RTP_HEADER_EXTENSION (buffer);
+ return GST_RTP_HEADER_EXTENSION (GST_BUFFER_DATA (buffer));
}
/**
@@ -659,10 +759,7 @@
void
gst_rtp_buffer_set_extension (GstBuffer * buffer, gboolean extension)
{
- g_return_if_fail (GST_IS_BUFFER (buffer));
- g_return_if_fail (GST_BUFFER_DATA (buffer) != NULL);
-
- GST_RTP_HEADER_EXTENSION (buffer) = extension;
+ GST_RTP_HEADER_EXTENSION (GST_BUFFER_DATA (buffer)) = extension;
}
/**
@@ -694,15 +791,14 @@
guint len;
guint8 *pdata;
- g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, FALSE);
+ pdata = GST_BUFFER_DATA (buffer);
- if (!GST_RTP_HEADER_EXTENSION (buffer))
+ if (!GST_RTP_HEADER_EXTENSION (pdata))
return FALSE;
/* move to the extension */
- len = GST_RTP_HEADER_LEN + GST_RTP_HEADER_CSRC_SIZE (buffer);
- pdata = GST_BUFFER_DATA (buffer) + len;
+ len = GST_RTP_HEADER_LEN + GST_RTP_HEADER_CSRC_SIZE (pdata);
+ pdata += len;
if (bits)
*bits = GST_READ_UINT16_BE (pdata);
@@ -740,27 +836,32 @@
guint32 min_size = 0;
guint8 *data;
- g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, FALSE);
+ data = GST_BUFFER_DATA (buffer);
- gst_rtp_buffer_set_extension (buffer, TRUE);
+ /* check if the buffer is big enough to hold the extension */
min_size =
- GST_RTP_HEADER_LEN + GST_RTP_HEADER_CSRC_SIZE (buffer) + 4 +
+ GST_RTP_HEADER_LEN + GST_RTP_HEADER_CSRC_SIZE (data) + 4 +
length * sizeof (guint32);
+ if (G_UNLIKELY (min_size > GST_BUFFER_SIZE (buffer)))
+ goto too_small;
+
+ /* now we can set the extension bit */
+ gst_rtp_buffer_set_extension (buffer, TRUE);
- if (min_size > GST_BUFFER_SIZE (buffer)) {
- GST_WARNING_OBJECT (buffer,
- "rtp buffer too small: need more than %d bytes but only have %d bytes",
+ data += GST_RTP_HEADER_LEN + GST_RTP_HEADER_CSRC_SIZE (data);
+ GST_WRITE_UINT16_BE (data, bits);
+ GST_WRITE_UINT16_BE (data + 2, length);
+
+ return TRUE;
+
+ /* ERRORS */
+too_small:
+ {
+ g_warning
+ ("rtp buffer too small: need more than %d bytes but only have %d bytes",
min_size, GST_BUFFER_SIZE (buffer));
return FALSE;
}
-
- data =
- GST_BUFFER_DATA (buffer) + GST_RTP_HEADER_LEN +
- GST_RTP_HEADER_CSRC_SIZE (buffer);
- GST_WRITE_UINT16_BE (data, bits);
- GST_WRITE_UINT16_BE (data + 2, length);
- return TRUE;
}
/**
@@ -778,10 +879,34 @@
guint32
gst_rtp_buffer_get_ssrc (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, 0);
+ return g_ntohl (GST_RTP_HEADER_SSRC (GST_BUFFER_DATA (buffer)));
+}
- return g_ntohl (GST_RTP_HEADER_SSRC (buffer));
+/**
+ * gst_rtp_buffer_list_get_ssrc:
+ * @list: the buffer list
+ *
+ * Get the SSRC of the first RTP packet in @list.
+ * All RTP packets within @list have the same SSRC.
+ *
+ * Returns: the SSRC of @list in host order.
+ *
+ * Since: 0.10.24
+ */
+
+ #ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+guint32
+gst_rtp_buffer_list_get_ssrc (GstBufferList * list)
+{
+ GstBuffer *buffer;
+
+ buffer = gst_buffer_list_get (list, 0, 0);
+ g_return_val_if_fail (buffer != NULL, 0);
+
+ return g_ntohl (GST_RTP_HEADER_SSRC (GST_BUFFER_DATA (buffer)));
}
/**
@@ -798,10 +923,32 @@
void
gst_rtp_buffer_set_ssrc (GstBuffer * buffer, guint32 ssrc)
{
- g_return_if_fail (GST_IS_BUFFER (buffer));
- g_return_if_fail (GST_BUFFER_DATA (buffer) != NULL);
+ GST_RTP_HEADER_SSRC (GST_BUFFER_DATA (buffer)) = g_htonl (ssrc);
+}
+
+static GstBufferListItem
+set_ssrc_header (GstBuffer ** buffer, guint group, guint idx, guint32 * ssrc)
+{
+ GST_RTP_HEADER_SSRC (GST_BUFFER_DATA (*buffer)) = g_htonl (*ssrc);
+ return GST_BUFFER_LIST_SKIP_GROUP;
+}
- GST_RTP_HEADER_SSRC (buffer) = g_htonl (ssrc);
+/**
+ * gst_rtp_buffer_list_set_ssrc:
+ * @list: the buffer list
+ * @ssrc: the new SSRC
+ *
+ * Set the SSRC on each RTP packet in @list to @ssrc.
+ *
+ * Since: 0.10.24
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+void
+gst_rtp_buffer_list_set_ssrc (GstBufferList * list, guint32 ssrc)
+{
+ gst_buffer_list_foreach (list, (GstBufferListFunc) set_ssrc_header, &ssrc);
}
/**
@@ -819,10 +966,7 @@
guint8
gst_rtp_buffer_get_csrc_count (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, 0);
-
- return GST_RTP_HEADER_CSRC_COUNT (buffer);
+ return GST_RTP_HEADER_CSRC_COUNT (GST_BUFFER_DATA (buffer));
}
/**
@@ -841,11 +985,13 @@
guint32
gst_rtp_buffer_get_csrc (GstBuffer * buffer, guint8 idx)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, 0);
- g_return_val_if_fail (idx < GST_RTP_HEADER_CSRC_COUNT (buffer), 0);
+ guint8 *data;
+
+ data = GST_BUFFER_DATA (buffer);
- return GST_READ_UINT32_BE (GST_RTP_HEADER_CSRC_LIST_OFFSET (buffer, idx));
+ g_return_val_if_fail (idx < GST_RTP_HEADER_CSRC_COUNT (data), 0);
+
+ return GST_READ_UINT32_BE (GST_RTP_HEADER_CSRC_LIST_OFFSET (data, idx));
}
/**
@@ -863,11 +1009,13 @@
void
gst_rtp_buffer_set_csrc (GstBuffer * buffer, guint8 idx, guint32 csrc)
{
- g_return_if_fail (GST_IS_BUFFER (buffer));
- g_return_if_fail (GST_BUFFER_DATA (buffer) != NULL);
- g_return_if_fail (idx < GST_RTP_HEADER_CSRC_COUNT (buffer));
+ guint8 *data;
+
+ data = GST_BUFFER_DATA (buffer);
- GST_WRITE_UINT32_BE (GST_RTP_HEADER_CSRC_LIST_OFFSET (buffer, idx), csrc);
+ g_return_if_fail (idx < GST_RTP_HEADER_CSRC_COUNT (data));
+
+ GST_WRITE_UINT32_BE (GST_RTP_HEADER_CSRC_LIST_OFFSET (data, idx), csrc);
}
/**
@@ -885,10 +1033,7 @@
gboolean
gst_rtp_buffer_get_marker (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, FALSE);
-
- return GST_RTP_HEADER_MARKER (buffer);
+ return GST_RTP_HEADER_MARKER (GST_BUFFER_DATA (buffer));
}
/**
@@ -905,10 +1050,7 @@
void
gst_rtp_buffer_set_marker (GstBuffer * buffer, gboolean marker)
{
- g_return_if_fail (GST_IS_BUFFER (buffer));
- g_return_if_fail (GST_BUFFER_DATA (buffer) != NULL);
-
- GST_RTP_HEADER_MARKER (buffer) = marker;
+ GST_RTP_HEADER_MARKER (GST_BUFFER_DATA (buffer)) = marker;
}
/**
@@ -926,10 +1068,34 @@
guint8
gst_rtp_buffer_get_payload_type (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, 0);
+ return GST_RTP_HEADER_PAYLOAD_TYPE (GST_BUFFER_DATA (buffer));
+}
- return GST_RTP_HEADER_PAYLOAD_TYPE (buffer);
+/**
+ * gst_rtp_buffer_list_get_payload_type:
+ * @list: the buffer list
+ *
+ * Get the payload type of the first RTP packet in @list.
+ * All packets in @list should have the same payload type.
+ *
+ * Returns: The payload type.
+ *
+ * Since: 0.10.24
+ */
+
+ #ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+guint8
+gst_rtp_buffer_list_get_payload_type (GstBufferList * list)
+{
+ GstBuffer *buffer;
+
+ buffer = gst_buffer_list_get (list, 0, 0);
+ g_return_val_if_fail (buffer != NULL, 0);
+
+ return GST_RTP_HEADER_PAYLOAD_TYPE (GST_BUFFER_DATA (buffer));
}
/**
@@ -946,11 +1112,39 @@
void
gst_rtp_buffer_set_payload_type (GstBuffer * buffer, guint8 payload_type)
{
- g_return_if_fail (GST_IS_BUFFER (buffer));
- g_return_if_fail (GST_BUFFER_DATA (buffer) != NULL);
g_return_if_fail (payload_type < 0x80);
- GST_RTP_HEADER_PAYLOAD_TYPE (buffer) = payload_type;
+ GST_RTP_HEADER_PAYLOAD_TYPE (GST_BUFFER_DATA (buffer)) = payload_type;
+}
+
+static GstBufferListItem
+set_pt_header (GstBuffer ** buffer, guint group, guint idx, guint8 * pt)
+{
+ GST_RTP_HEADER_PAYLOAD_TYPE (GST_BUFFER_DATA (*buffer)) = *pt;
+ return GST_BUFFER_LIST_SKIP_GROUP;
+}
+
+/**
+ * gst_rtp_buffer_list_set_payload_type:
+ * @list: the buffer list
+ * @payload_type: the new type
+ *
+ * Set the payload type of each RTP packet in @list to @payload_type.
+ *
+ * Since: 0.10.24
+ */
+
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_rtp_buffer_list_set_payload_type (GstBufferList * list, guint8 payload_type)
+{
+ g_return_if_fail (payload_type < 0x80);
+
+ gst_buffer_list_foreach (list, (GstBufferListFunc) set_pt_header,
+ &payload_type);
}
/**
@@ -968,10 +1162,7 @@
guint16
gst_rtp_buffer_get_seq (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, 0);
-
- return g_ntohs (GST_RTP_HEADER_SEQ (buffer));
+ return g_ntohs (GST_RTP_HEADER_SEQ (GST_BUFFER_DATA (buffer)));
}
/**
@@ -988,13 +1179,69 @@
void
gst_rtp_buffer_set_seq (GstBuffer * buffer, guint16 seq)
{
- g_return_if_fail (GST_IS_BUFFER (buffer));
- g_return_if_fail (GST_BUFFER_DATA (buffer) != NULL);
+ GST_RTP_HEADER_SEQ (GST_BUFFER_DATA (buffer)) = g_htons (seq);
+}
+
+static GstBufferListItem
+set_seq_header (GstBuffer ** buffer, guint group, guint idx, guint16 * seq)
+{
+ GST_RTP_HEADER_SEQ (GST_BUFFER_DATA (*buffer)) = g_htons (*seq);
+ (*seq)++;
+ return GST_BUFFER_LIST_SKIP_GROUP;
+}
+
+/**
+ * gst_rtp_buffer_list_set_seq:
+ * @list: the buffer list
+ * @seq: the new sequence number
+ *
+ * Set the sequence number of each RTP packet in @list to @seq.
+ *
+ * Returns: The seq number of the last packet in the list + 1.
+ *
+ * Since: 0.10.24
+ */
+
+ #ifdef __SYMBIAN32__
+EXPORT_C
+#endif
- GST_RTP_HEADER_SEQ (buffer) = g_htons (seq);
+guint16
+gst_rtp_buffer_list_set_seq (GstBufferList * list, guint16 seq)
+{
+ gst_buffer_list_foreach (list, (GstBufferListFunc) set_seq_header, &seq);
+ return seq;
}
/**
+ * gst_rtp_buffer_list_get_seq:
+ * @list: the buffer list
+ *
+ * Get the sequence number of the first RTP packet in @list.
+ * All packets within @list have the same sequence number.
+ *
+ * Returns: The seq number
+ *
+ * Since: 0.10.24
+ */
+
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+guint16
+gst_rtp_buffer_list_get_seq (GstBufferList * list)
+{
+ GstBuffer *buffer;
+
+ buffer = gst_buffer_list_get (list, 0, 0);
+ g_return_val_if_fail (buffer != NULL, 0);
+
+ return g_ntohl (GST_RTP_HEADER_SEQ (GST_BUFFER_DATA (buffer)));
+}
+
+
+/**
* gst_rtp_buffer_get_timestamp:
* @buffer: the buffer
*
@@ -1009,10 +1256,34 @@
guint32
gst_rtp_buffer_get_timestamp (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, 0);
+ return g_ntohl (GST_RTP_HEADER_TIMESTAMP (GST_BUFFER_DATA (buffer)));
+}
- return g_ntohl (GST_RTP_HEADER_TIMESTAMP (buffer));
+/**
+ * gst_rtp_buffer_list_get_timestamp:
+ * @list: the buffer list
+ *
+ * Get the timestamp of the first RTP packet in @list.
+ * All packets within @list have the same timestamp.
+ *
+ * Returns: The timestamp in host order.
+ *
+ * Since: 0.10.24
+ */
+
+ #ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+guint32
+gst_rtp_buffer_list_get_timestamp (GstBufferList * list)
+{
+ GstBuffer *buffer;
+
+ buffer = gst_buffer_list_get (list, 0, 0);
+ g_return_val_if_fail (buffer != NULL, 0);
+
+ return g_ntohl (GST_RTP_HEADER_TIMESTAMP (GST_BUFFER_DATA (buffer)));
}
/**
@@ -1029,10 +1300,37 @@
void
gst_rtp_buffer_set_timestamp (GstBuffer * buffer, guint32 timestamp)
{
- g_return_if_fail (GST_IS_BUFFER (buffer));
- g_return_if_fail (GST_BUFFER_DATA (buffer) != NULL);
+ GST_RTP_HEADER_TIMESTAMP (GST_BUFFER_DATA (buffer)) = g_htonl (timestamp);
+}
+
+
+static GstBufferListItem
+set_timestamp_header (GstBuffer ** buffer, guint group, guint idx,
+ guint32 * timestamp)
+{
+ GST_RTP_HEADER_TIMESTAMP (GST_BUFFER_DATA (*buffer)) = g_htonl (*timestamp);
+ return GST_BUFFER_LIST_SKIP_GROUP;
+}
- GST_RTP_HEADER_TIMESTAMP (buffer) = g_htonl (timestamp);
+/**
+ * gst_rtp_buffer_list_set_timestamp:
+ * @list: the buffer list
+ * @timestamp: the new timestamp
+ *
+ * Set the timestamp of each RTP packet in @list to @timestamp.
+ *
+ * Since: 0.10.24
+ */
+
+ #ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+void
+gst_rtp_buffer_list_set_timestamp (GstBufferList * list, guint32 timestamp)
+{
+ gst_buffer_list_foreach (list, (GstBufferListFunc) set_timestamp_header,
+ ×tamp);
}
/**
@@ -1059,15 +1357,10 @@
{
guint poffset, plen;
- g_return_val_if_fail (GST_IS_BUFFER (buffer), NULL);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, NULL);
-
plen = gst_rtp_buffer_get_payload_len (buffer);
/* we can't go past the length */
- if (G_UNLIKELY (offset >= plen)) {
- GST_WARNING ("offset=%u should be less then plen=%u", offset, plen);
- return (NULL);
- }
+ if (G_UNLIKELY (offset >= plen))
+ goto wrong_offset;
/* apply offset */
poffset = gst_rtp_buffer_get_header_len (buffer) + offset;
@@ -1078,6 +1371,13 @@
plen = len;
return gst_buffer_create_sub (buffer, poffset, plen);
+
+ /* ERRORS */
+wrong_offset:
+ {
+ g_warning ("offset=%u should be less then plen=%u", offset, plen);
+ return NULL;
+ }
}
/**
@@ -1116,16 +1416,58 @@
gst_rtp_buffer_get_payload_len (GstBuffer * buffer)
{
guint len, size;
-
- g_return_val_if_fail (GST_IS_BUFFER (buffer), 0);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, 0);
+ guint8 *data;
size = GST_BUFFER_SIZE (buffer);
+ data = GST_BUFFER_DATA (buffer);
len = size - gst_rtp_buffer_get_header_len (buffer);
- if (GST_RTP_HEADER_PADDING (buffer))
- len -= GST_BUFFER_DATA (buffer)[size - 1];
+ if (GST_RTP_HEADER_PADDING (data))
+ len -= data[size - 1];
+
+ return len;
+}
+
+/**
+ * gst_rtp_buffer_list_get_payload_len:
+ * @list: the buffer list
+ *
+ * Get the length of the payload of the RTP packet in @list.
+ *
+ * Returns: The length of the payload in @list.
+ *
+ * Since: 0.10.24
+ */
+
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+guint
+gst_rtp_buffer_list_get_payload_len (GstBufferList * list)
+{
+ guint len;
+ GstBufferListIterator *it;
+
+ it = gst_buffer_list_iterate (list);
+ len = 0;
+
+ while (gst_buffer_list_iterator_next_group (it)) {
+ guint i;
+ GstBuffer *buf;
+
+ i = 0;
+ while ((buf = gst_buffer_list_iterator_next (it))) {
+ /* skip the RTP header */
+ if (!i++)
+ continue;
+ /* take the size of the current buffer */
+ len += GST_BUFFER_SIZE (buf);
+ }
+ }
+
+ gst_buffer_list_iterator_free (it);
return len;
}
@@ -1146,9 +1488,6 @@
gpointer
gst_rtp_buffer_get_payload (GstBuffer * buffer)
{
- g_return_val_if_fail (GST_IS_BUFFER (buffer), NULL);
- g_return_val_if_fail (GST_BUFFER_DATA (buffer) != NULL, NULL);
-
return GST_BUFFER_DATA (buffer) + gst_rtp_buffer_get_header_len (buffer);
}
@@ -1190,10 +1529,11 @@
* @seqnum1: a sequence number
* @seqnum2: a sequence number
*
- * Compare two sequence numbers, taking care of wraparounds.
+ * Compare two sequence numbers, taking care of wraparounds. This function
+ * returns the difference between @seqnum1 and @seqnum2.
*
- * Returns: -1 if @seqnum1 is before @seqnum2, 0 if they are equal or 1 if
- * @seqnum1 is bigger than @segnum2.
+ * Returns: a negative value if @seqnum1 is bigger than @seqnum2, 0 if they
+ * are equal or a positive value if @seqnum1 is smaller than @segnum2.
*
* Since: 0.10.15
*/
@@ -1204,13 +1544,7 @@
gint
gst_rtp_buffer_compare_seqnum (guint16 seqnum1, guint16 seqnum2)
{
- /* check if diff more than half of the 16bit range */
- if (abs (seqnum2 - seqnum1) > (1 << 15)) {
- /* one of a/b has wrapped */
- return seqnum1 - seqnum2;
- } else {
- return seqnum2 - seqnum1;
- }
+ return (gint16) (seqnum2 - seqnum1);
}
/**
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/gstrtpbuffer.h
--- a/gst_plugins_base/gst-libs/gst/rtp/gstrtpbuffer.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtp/gstrtpbuffer.h Wed Mar 24 18:04:17 2010 -0500
@@ -95,6 +95,11 @@
IMPORT_C
#endif
+gboolean gst_rtp_buffer_list_validate (GstBufferList *list);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
void gst_rtp_buffer_set_packet_len (GstBuffer *buffer, guint len);
#ifdef __SYMBIAN32__
@@ -167,11 +172,21 @@
IMPORT_C
#endif
+guint32 gst_rtp_buffer_list_get_ssrc (GstBufferList *list);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
void gst_rtp_buffer_set_ssrc (GstBuffer *buffer, guint32 ssrc);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
+void gst_rtp_buffer_list_set_ssrc (GstBufferList *list, guint32 ssrc);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
guint8 gst_rtp_buffer_get_csrc_count (GstBuffer *buffer);
#ifdef __SYMBIAN32__
@@ -205,33 +220,63 @@
IMPORT_C
#endif
+guint8 gst_rtp_buffer_list_get_payload_type (GstBufferList *list);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
void gst_rtp_buffer_set_payload_type (GstBuffer *buffer, guint8 payload_type);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
+void gst_rtp_buffer_list_set_payload_type (GstBufferList *list, guint8 payload_type);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
guint16 gst_rtp_buffer_get_seq (GstBuffer *buffer);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
+guint16 gst_rtp_buffer_list_get_seq (GstBufferList *list);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
void gst_rtp_buffer_set_seq (GstBuffer *buffer, guint16 seq);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
+guint16 gst_rtp_buffer_list_set_seq (GstBufferList *list, guint16 seq);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
guint32 gst_rtp_buffer_get_timestamp (GstBuffer *buffer);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
+guint32 gst_rtp_buffer_list_get_timestamp (GstBufferList *list);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
void gst_rtp_buffer_set_timestamp (GstBuffer *buffer, guint32 timestamp);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
+void gst_rtp_buffer_list_set_timestamp (GstBufferList *list, guint32 timestamp);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
GstBuffer* gst_rtp_buffer_get_payload_buffer (GstBuffer *buffer);
#ifdef __SYMBIAN32__
@@ -249,6 +294,11 @@
IMPORT_C
#endif
+guint gst_rtp_buffer_list_get_payload_len (GstBufferList *list);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
gpointer gst_rtp_buffer_get_payload (GstBuffer *buffer);
/* some helpers */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtp/gstrtppayloads.c
--- a/gst_plugins_base/gst-libs/gst/rtp/gstrtppayloads.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtp/gstrtppayloads.c Wed Mar 24 18:04:17 2010 -0500
@@ -228,7 +228,7 @@
for (i = 0; info[i].media; i++) {
if (strcmp (media, info[i].media) == 0
- && g_strcasecmp (encoding_name, info[i].encoding_name) == 0) {
+ && g_ascii_strcasecmp (encoding_name, info[i].encoding_name) == 0) {
result = &info[i];
break;
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtsp-enumtypes.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtsp-enumtypes.c Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,295 @@
+
+/* Generated data (by glib-mkenums) */
+
+#include "gstrtsp-enumtypes.h"
+
+#include "gstrtspdefs.h"
+
+/* enumerations from "gstrtspdefs.h" */
+GType
+gst_rtsp_result_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_RTSP_OK, "GST_RTSP_OK", "ok" },
+ { GST_RTSP_ERROR, "GST_RTSP_ERROR", "error" },
+ { GST_RTSP_EINVAL, "GST_RTSP_EINVAL", "einval" },
+ { GST_RTSP_EINTR, "GST_RTSP_EINTR", "eintr" },
+ { GST_RTSP_ENOMEM, "GST_RTSP_ENOMEM", "enomem" },
+ { GST_RTSP_ERESOLV, "GST_RTSP_ERESOLV", "eresolv" },
+ { GST_RTSP_ENOTIMPL, "GST_RTSP_ENOTIMPL", "enotimpl" },
+ { GST_RTSP_ESYS, "GST_RTSP_ESYS", "esys" },
+ { GST_RTSP_EPARSE, "GST_RTSP_EPARSE", "eparse" },
+ { GST_RTSP_EWSASTART, "GST_RTSP_EWSASTART", "ewsastart" },
+ { GST_RTSP_EWSAVERSION, "GST_RTSP_EWSAVERSION", "ewsaversion" },
+ { GST_RTSP_EEOF, "GST_RTSP_EEOF", "eeof" },
+ { GST_RTSP_ENET, "GST_RTSP_ENET", "enet" },
+ { GST_RTSP_ENOTIP, "GST_RTSP_ENOTIP", "enotip" },
+ { GST_RTSP_ETIMEOUT, "GST_RTSP_ETIMEOUT", "etimeout" },
+ { GST_RTSP_ETGET, "GST_RTSP_ETGET", "etget" },
+ { GST_RTSP_ETPOST, "GST_RTSP_ETPOST", "etpost" },
+ { GST_RTSP_ELAST, "GST_RTSP_ELAST", "elast" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstRTSPResult", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+GType
+gst_rtsp_event_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GFlagsValue values[] = {
+ { GST_RTSP_EV_READ, "GST_RTSP_EV_READ", "read" },
+ { GST_RTSP_EV_WRITE, "GST_RTSP_EV_WRITE", "write" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_flags_register_static ("GstRTSPEvent", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+GType
+gst_rtsp_family_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_RTSP_FAM_NONE, "GST_RTSP_FAM_NONE", "none" },
+ { GST_RTSP_FAM_INET, "GST_RTSP_FAM_INET", "inet" },
+ { GST_RTSP_FAM_INET6, "GST_RTSP_FAM_INET6", "inet6" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstRTSPFamily", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+GType
+gst_rtsp_state_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_RTSP_STATE_INVALID, "GST_RTSP_STATE_INVALID", "invalid" },
+ { GST_RTSP_STATE_INIT, "GST_RTSP_STATE_INIT", "init" },
+ { GST_RTSP_STATE_READY, "GST_RTSP_STATE_READY", "ready" },
+ { GST_RTSP_STATE_SEEKING, "GST_RTSP_STATE_SEEKING", "seeking" },
+ { GST_RTSP_STATE_PLAYING, "GST_RTSP_STATE_PLAYING", "playing" },
+ { GST_RTSP_STATE_RECORDING, "GST_RTSP_STATE_RECORDING", "recording" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstRTSPState", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+GType
+gst_rtsp_version_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_RTSP_VERSION_INVALID, "GST_RTSP_VERSION_INVALID", "invalid" },
+ { GST_RTSP_VERSION_1_0, "GST_RTSP_VERSION_1_0", "1-0" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstRTSPVersion", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+GType
+gst_rtsp_method_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GFlagsValue values[] = {
+ { GST_RTSP_INVALID, "GST_RTSP_INVALID", "invalid" },
+ { GST_RTSP_DESCRIBE, "GST_RTSP_DESCRIBE", "describe" },
+ { GST_RTSP_ANNOUNCE, "GST_RTSP_ANNOUNCE", "announce" },
+ { GST_RTSP_GET_PARAMETER, "GST_RTSP_GET_PARAMETER", "get-parameter" },
+ { GST_RTSP_OPTIONS, "GST_RTSP_OPTIONS", "options" },
+ { GST_RTSP_PAUSE, "GST_RTSP_PAUSE", "pause" },
+ { GST_RTSP_PLAY, "GST_RTSP_PLAY", "play" },
+ { GST_RTSP_RECORD, "GST_RTSP_RECORD", "record" },
+ { GST_RTSP_REDIRECT, "GST_RTSP_REDIRECT", "redirect" },
+ { GST_RTSP_SETUP, "GST_RTSP_SETUP", "setup" },
+ { GST_RTSP_SET_PARAMETER, "GST_RTSP_SET_PARAMETER", "set-parameter" },
+ { GST_RTSP_TEARDOWN, "GST_RTSP_TEARDOWN", "teardown" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_flags_register_static ("GstRTSPMethod", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+GType
+gst_rtsp_auth_method_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_RTSP_AUTH_NONE, "GST_RTSP_AUTH_NONE", "none" },
+ { GST_RTSP_AUTH_BASIC, "GST_RTSP_AUTH_BASIC", "basic" },
+ { GST_RTSP_AUTH_DIGEST, "GST_RTSP_AUTH_DIGEST", "digest" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstRTSPAuthMethod", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+GType
+gst_rtsp_header_field_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_RTSP_HDR_INVALID, "GST_RTSP_HDR_INVALID", "invalid" },
+ { GST_RTSP_HDR_ACCEPT, "GST_RTSP_HDR_ACCEPT", "accept" },
+ { GST_RTSP_HDR_ACCEPT_ENCODING, "GST_RTSP_HDR_ACCEPT_ENCODING", "accept-encoding" },
+ { GST_RTSP_HDR_ACCEPT_LANGUAGE, "GST_RTSP_HDR_ACCEPT_LANGUAGE", "accept-language" },
+ { GST_RTSP_HDR_ALLOW, "GST_RTSP_HDR_ALLOW", "allow" },
+ { GST_RTSP_HDR_AUTHORIZATION, "GST_RTSP_HDR_AUTHORIZATION", "authorization" },
+ { GST_RTSP_HDR_BANDWIDTH, "GST_RTSP_HDR_BANDWIDTH", "bandwidth" },
+ { GST_RTSP_HDR_BLOCKSIZE, "GST_RTSP_HDR_BLOCKSIZE", "blocksize" },
+ { GST_RTSP_HDR_CACHE_CONTROL, "GST_RTSP_HDR_CACHE_CONTROL", "cache-control" },
+ { GST_RTSP_HDR_CONFERENCE, "GST_RTSP_HDR_CONFERENCE", "conference" },
+ { GST_RTSP_HDR_CONNECTION, "GST_RTSP_HDR_CONNECTION", "connection" },
+ { GST_RTSP_HDR_CONTENT_BASE, "GST_RTSP_HDR_CONTENT_BASE", "content-base" },
+ { GST_RTSP_HDR_CONTENT_ENCODING, "GST_RTSP_HDR_CONTENT_ENCODING", "content-encoding" },
+ { GST_RTSP_HDR_CONTENT_LANGUAGE, "GST_RTSP_HDR_CONTENT_LANGUAGE", "content-language" },
+ { GST_RTSP_HDR_CONTENT_LENGTH, "GST_RTSP_HDR_CONTENT_LENGTH", "content-length" },
+ { GST_RTSP_HDR_CONTENT_LOCATION, "GST_RTSP_HDR_CONTENT_LOCATION", "content-location" },
+ { GST_RTSP_HDR_CONTENT_TYPE, "GST_RTSP_HDR_CONTENT_TYPE", "content-type" },
+ { GST_RTSP_HDR_CSEQ, "GST_RTSP_HDR_CSEQ", "cseq" },
+ { GST_RTSP_HDR_DATE, "GST_RTSP_HDR_DATE", "date" },
+ { GST_RTSP_HDR_EXPIRES, "GST_RTSP_HDR_EXPIRES", "expires" },
+ { GST_RTSP_HDR_FROM, "GST_RTSP_HDR_FROM", "from" },
+ { GST_RTSP_HDR_IF_MODIFIED_SINCE, "GST_RTSP_HDR_IF_MODIFIED_SINCE", "if-modified-since" },
+ { GST_RTSP_HDR_LAST_MODIFIED, "GST_RTSP_HDR_LAST_MODIFIED", "last-modified" },
+ { GST_RTSP_HDR_PROXY_AUTHENTICATE, "GST_RTSP_HDR_PROXY_AUTHENTICATE", "proxy-authenticate" },
+ { GST_RTSP_HDR_PROXY_REQUIRE, "GST_RTSP_HDR_PROXY_REQUIRE", "proxy-require" },
+ { GST_RTSP_HDR_PUBLIC, "GST_RTSP_HDR_PUBLIC", "public" },
+ { GST_RTSP_HDR_RANGE, "GST_RTSP_HDR_RANGE", "range" },
+ { GST_RTSP_HDR_REFERER, "GST_RTSP_HDR_REFERER", "referer" },
+ { GST_RTSP_HDR_REQUIRE, "GST_RTSP_HDR_REQUIRE", "require" },
+ { GST_RTSP_HDR_RETRY_AFTER, "GST_RTSP_HDR_RETRY_AFTER", "retry-after" },
+ { GST_RTSP_HDR_RTP_INFO, "GST_RTSP_HDR_RTP_INFO", "rtp-info" },
+ { GST_RTSP_HDR_SCALE, "GST_RTSP_HDR_SCALE", "scale" },
+ { GST_RTSP_HDR_SESSION, "GST_RTSP_HDR_SESSION", "session" },
+ { GST_RTSP_HDR_SERVER, "GST_RTSP_HDR_SERVER", "server" },
+ { GST_RTSP_HDR_SPEED, "GST_RTSP_HDR_SPEED", "speed" },
+ { GST_RTSP_HDR_TRANSPORT, "GST_RTSP_HDR_TRANSPORT", "transport" },
+ { GST_RTSP_HDR_UNSUPPORTED, "GST_RTSP_HDR_UNSUPPORTED", "unsupported" },
+ { GST_RTSP_HDR_USER_AGENT, "GST_RTSP_HDR_USER_AGENT", "user-agent" },
+ { GST_RTSP_HDR_VIA, "GST_RTSP_HDR_VIA", "via" },
+ { GST_RTSP_HDR_WWW_AUTHENTICATE, "GST_RTSP_HDR_WWW_AUTHENTICATE", "www-authenticate" },
+ { GST_RTSP_HDR_CLIENT_CHALLENGE, "GST_RTSP_HDR_CLIENT_CHALLENGE", "client-challenge" },
+ { GST_RTSP_HDR_REAL_CHALLENGE1, "GST_RTSP_HDR_REAL_CHALLENGE1", "real-challenge1" },
+ { GST_RTSP_HDR_REAL_CHALLENGE2, "GST_RTSP_HDR_REAL_CHALLENGE2", "real-challenge2" },
+ { GST_RTSP_HDR_REAL_CHALLENGE3, "GST_RTSP_HDR_REAL_CHALLENGE3", "real-challenge3" },
+ { GST_RTSP_HDR_SUBSCRIBE, "GST_RTSP_HDR_SUBSCRIBE", "subscribe" },
+ { GST_RTSP_HDR_ALERT, "GST_RTSP_HDR_ALERT", "alert" },
+ { GST_RTSP_HDR_CLIENT_ID, "GST_RTSP_HDR_CLIENT_ID", "client-id" },
+ { GST_RTSP_HDR_COMPANY_ID, "GST_RTSP_HDR_COMPANY_ID", "company-id" },
+ { GST_RTSP_HDR_GUID, "GST_RTSP_HDR_GUID", "guid" },
+ { GST_RTSP_HDR_REGION_DATA, "GST_RTSP_HDR_REGION_DATA", "region-data" },
+ { GST_RTSP_HDR_MAX_ASM_WIDTH, "GST_RTSP_HDR_MAX_ASM_WIDTH", "max-asm-width" },
+ { GST_RTSP_HDR_LANGUAGE, "GST_RTSP_HDR_LANGUAGE", "language" },
+ { GST_RTSP_HDR_PLAYER_START_TIME, "GST_RTSP_HDR_PLAYER_START_TIME", "player-start-time" },
+ { GST_RTSP_HDR_LOCATION, "GST_RTSP_HDR_LOCATION", "location" },
+ { GST_RTSP_HDR_ETAG, "GST_RTSP_HDR_ETAG", "etag" },
+ { GST_RTSP_HDR_IF_MATCH, "GST_RTSP_HDR_IF_MATCH", "if-match" },
+ { GST_RTSP_HDR_ACCEPT_CHARSET, "GST_RTSP_HDR_ACCEPT_CHARSET", "accept-charset" },
+ { GST_RTSP_HDR_SUPPORTED, "GST_RTSP_HDR_SUPPORTED", "supported" },
+ { GST_RTSP_HDR_VARY, "GST_RTSP_HDR_VARY", "vary" },
+ { GST_RTSP_HDR_X_ACCELERATE_STREAMING, "GST_RTSP_HDR_X_ACCELERATE_STREAMING", "x-accelerate-streaming" },
+ { GST_RTSP_HDR_X_ACCEPT_AUTHENT, "GST_RTSP_HDR_X_ACCEPT_AUTHENT", "x-accept-authent" },
+ { GST_RTSP_HDR_X_ACCEPT_PROXY_AUTHENT, "GST_RTSP_HDR_X_ACCEPT_PROXY_AUTHENT", "x-accept-proxy-authent" },
+ { GST_RTSP_HDR_X_BROADCAST_ID, "GST_RTSP_HDR_X_BROADCAST_ID", "x-broadcast-id" },
+ { GST_RTSP_HDR_X_BURST_STREAMING, "GST_RTSP_HDR_X_BURST_STREAMING", "x-burst-streaming" },
+ { GST_RTSP_HDR_X_NOTICE, "GST_RTSP_HDR_X_NOTICE", "x-notice" },
+ { GST_RTSP_HDR_X_PLAYER_LAG_TIME, "GST_RTSP_HDR_X_PLAYER_LAG_TIME", "x-player-lag-time" },
+ { GST_RTSP_HDR_X_PLAYLIST, "GST_RTSP_HDR_X_PLAYLIST", "x-playlist" },
+ { GST_RTSP_HDR_X_PLAYLIST_CHANGE_NOTICE, "GST_RTSP_HDR_X_PLAYLIST_CHANGE_NOTICE", "x-playlist-change-notice" },
+ { GST_RTSP_HDR_X_PLAYLIST_GEN_ID, "GST_RTSP_HDR_X_PLAYLIST_GEN_ID", "x-playlist-gen-id" },
+ { GST_RTSP_HDR_X_PLAYLIST_SEEK_ID, "GST_RTSP_HDR_X_PLAYLIST_SEEK_ID", "x-playlist-seek-id" },
+ { GST_RTSP_HDR_X_PROXY_CLIENT_AGENT, "GST_RTSP_HDR_X_PROXY_CLIENT_AGENT", "x-proxy-client-agent" },
+ { GST_RTSP_HDR_X_PROXY_CLIENT_VERB, "GST_RTSP_HDR_X_PROXY_CLIENT_VERB", "x-proxy-client-verb" },
+ { GST_RTSP_HDR_X_RECEDING_PLAYLISTCHANGE, "GST_RTSP_HDR_X_RECEDING_PLAYLISTCHANGE", "x-receding-playlistchange" },
+ { GST_RTSP_HDR_X_RTP_INFO, "GST_RTSP_HDR_X_RTP_INFO", "x-rtp-info" },
+ { GST_RTSP_HDR_X_STARTUPPROFILE, "GST_RTSP_HDR_X_STARTUPPROFILE", "x-startupprofile" },
+ { GST_RTSP_HDR_TIMESTAMP, "GST_RTSP_HDR_TIMESTAMP", "timestamp" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstRTSPHeaderField", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+GType
+gst_rtsp_status_code_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_RTSP_STS_INVALID, "GST_RTSP_STS_INVALID", "invalid" },
+ { GST_RTSP_STS_CONTINUE, "GST_RTSP_STS_CONTINUE", "continue" },
+ { GST_RTSP_STS_OK, "GST_RTSP_STS_OK", "ok" },
+ { GST_RTSP_STS_CREATED, "GST_RTSP_STS_CREATED", "created" },
+ { GST_RTSP_STS_LOW_ON_STORAGE, "GST_RTSP_STS_LOW_ON_STORAGE", "low-on-storage" },
+ { GST_RTSP_STS_MULTIPLE_CHOICES, "GST_RTSP_STS_MULTIPLE_CHOICES", "multiple-choices" },
+ { GST_RTSP_STS_MOVED_PERMANENTLY, "GST_RTSP_STS_MOVED_PERMANENTLY", "moved-permanently" },
+ { GST_RTSP_STS_MOVE_TEMPORARILY, "GST_RTSP_STS_MOVE_TEMPORARILY", "move-temporarily" },
+ { GST_RTSP_STS_SEE_OTHER, "GST_RTSP_STS_SEE_OTHER", "see-other" },
+ { GST_RTSP_STS_NOT_MODIFIED, "GST_RTSP_STS_NOT_MODIFIED", "not-modified" },
+ { GST_RTSP_STS_USE_PROXY, "GST_RTSP_STS_USE_PROXY", "use-proxy" },
+ { GST_RTSP_STS_BAD_REQUEST, "GST_RTSP_STS_BAD_REQUEST", "bad-request" },
+ { GST_RTSP_STS_UNAUTHORIZED, "GST_RTSP_STS_UNAUTHORIZED", "unauthorized" },
+ { GST_RTSP_STS_PAYMENT_REQUIRED, "GST_RTSP_STS_PAYMENT_REQUIRED", "payment-required" },
+ { GST_RTSP_STS_FORBIDDEN, "GST_RTSP_STS_FORBIDDEN", "forbidden" },
+ { GST_RTSP_STS_NOT_FOUND, "GST_RTSP_STS_NOT_FOUND", "not-found" },
+ { GST_RTSP_STS_METHOD_NOT_ALLOWED, "GST_RTSP_STS_METHOD_NOT_ALLOWED", "method-not-allowed" },
+ { GST_RTSP_STS_NOT_ACCEPTABLE, "GST_RTSP_STS_NOT_ACCEPTABLE", "not-acceptable" },
+ { GST_RTSP_STS_PROXY_AUTH_REQUIRED, "GST_RTSP_STS_PROXY_AUTH_REQUIRED", "proxy-auth-required" },
+ { GST_RTSP_STS_REQUEST_TIMEOUT, "GST_RTSP_STS_REQUEST_TIMEOUT", "request-timeout" },
+ { GST_RTSP_STS_GONE, "GST_RTSP_STS_GONE", "gone" },
+ { GST_RTSP_STS_LENGTH_REQUIRED, "GST_RTSP_STS_LENGTH_REQUIRED", "length-required" },
+ { GST_RTSP_STS_PRECONDITION_FAILED, "GST_RTSP_STS_PRECONDITION_FAILED", "precondition-failed" },
+ { GST_RTSP_STS_REQUEST_ENTITY_TOO_LARGE, "GST_RTSP_STS_REQUEST_ENTITY_TOO_LARGE", "request-entity-too-large" },
+ { GST_RTSP_STS_REQUEST_URI_TOO_LARGE, "GST_RTSP_STS_REQUEST_URI_TOO_LARGE", "request-uri-too-large" },
+ { GST_RTSP_STS_UNSUPPORTED_MEDIA_TYPE, "GST_RTSP_STS_UNSUPPORTED_MEDIA_TYPE", "unsupported-media-type" },
+ { GST_RTSP_STS_PARAMETER_NOT_UNDERSTOOD, "GST_RTSP_STS_PARAMETER_NOT_UNDERSTOOD", "parameter-not-understood" },
+ { GST_RTSP_STS_CONFERENCE_NOT_FOUND, "GST_RTSP_STS_CONFERENCE_NOT_FOUND", "conference-not-found" },
+ { GST_RTSP_STS_NOT_ENOUGH_BANDWIDTH, "GST_RTSP_STS_NOT_ENOUGH_BANDWIDTH", "not-enough-bandwidth" },
+ { GST_RTSP_STS_SESSION_NOT_FOUND, "GST_RTSP_STS_SESSION_NOT_FOUND", "session-not-found" },
+ { GST_RTSP_STS_METHOD_NOT_VALID_IN_THIS_STATE, "GST_RTSP_STS_METHOD_NOT_VALID_IN_THIS_STATE", "method-not-valid-in-this-state" },
+ { GST_RTSP_STS_HEADER_FIELD_NOT_VALID_FOR_RESOURCE, "GST_RTSP_STS_HEADER_FIELD_NOT_VALID_FOR_RESOURCE", "header-field-not-valid-for-resource" },
+ { GST_RTSP_STS_INVALID_RANGE, "GST_RTSP_STS_INVALID_RANGE", "invalid-range" },
+ { GST_RTSP_STS_PARAMETER_IS_READONLY, "GST_RTSP_STS_PARAMETER_IS_READONLY", "parameter-is-readonly" },
+ { GST_RTSP_STS_AGGREGATE_OPERATION_NOT_ALLOWED, "GST_RTSP_STS_AGGREGATE_OPERATION_NOT_ALLOWED", "aggregate-operation-not-allowed" },
+ { GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, "GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED", "only-aggregate-operation-allowed" },
+ { GST_RTSP_STS_UNSUPPORTED_TRANSPORT, "GST_RTSP_STS_UNSUPPORTED_TRANSPORT", "unsupported-transport" },
+ { GST_RTSP_STS_DESTINATION_UNREACHABLE, "GST_RTSP_STS_DESTINATION_UNREACHABLE", "destination-unreachable" },
+ { GST_RTSP_STS_INTERNAL_SERVER_ERROR, "GST_RTSP_STS_INTERNAL_SERVER_ERROR", "internal-server-error" },
+ { GST_RTSP_STS_NOT_IMPLEMENTED, "GST_RTSP_STS_NOT_IMPLEMENTED", "not-implemented" },
+ { GST_RTSP_STS_BAD_GATEWAY, "GST_RTSP_STS_BAD_GATEWAY", "bad-gateway" },
+ { GST_RTSP_STS_SERVICE_UNAVAILABLE, "GST_RTSP_STS_SERVICE_UNAVAILABLE", "service-unavailable" },
+ { GST_RTSP_STS_GATEWAY_TIMEOUT, "GST_RTSP_STS_GATEWAY_TIMEOUT", "gateway-timeout" },
+ { GST_RTSP_STS_RTSP_VERSION_NOT_SUPPORTED, "GST_RTSP_STS_RTSP_VERSION_NOT_SUPPORTED", "rtsp-version-not-supported" },
+ { GST_RTSP_STS_OPTION_NOT_SUPPORTED, "GST_RTSP_STS_OPTION_NOT_SUPPORTED", "option-not-supported" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstRTSPStatusCode", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+
+/* Generated data ends here */
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtsp-enumtypes.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtsp-enumtypes.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,35 @@
+
+/* Generated data (by glib-mkenums) */
+
+#ifndef __gst_rtsp_ENUM_TYPES_H__
+#define __gst_rtsp_ENUM_TYPES_H__
+
+#include
+
+G_BEGIN_DECLS
+
+/* enumerations from "gstrtspdefs.h" */
+GType gst_rtsp_result_get_type (void);
+#define GST_TYPE_RTSP_RESULT (gst_rtsp_result_get_type())
+GType gst_rtsp_event_get_type (void);
+#define GST_TYPE_RTSP_EVENT (gst_rtsp_event_get_type())
+GType gst_rtsp_family_get_type (void);
+#define GST_TYPE_RTSP_FAMILY (gst_rtsp_family_get_type())
+GType gst_rtsp_state_get_type (void);
+#define GST_TYPE_RTSP_STATE (gst_rtsp_state_get_type())
+GType gst_rtsp_version_get_type (void);
+#define GST_TYPE_RTSP_VERSION (gst_rtsp_version_get_type())
+GType gst_rtsp_method_get_type (void);
+#define GST_TYPE_RTSP_METHOD (gst_rtsp_method_get_type())
+GType gst_rtsp_auth_method_get_type (void);
+#define GST_TYPE_RTSP_AUTH_METHOD (gst_rtsp_auth_method_get_type())
+GType gst_rtsp_header_field_get_type (void);
+#define GST_TYPE_RTSP_HEADER_FIELD (gst_rtsp_header_field_get_type())
+GType gst_rtsp_status_code_get_type (void);
+#define GST_TYPE_RTSP_STATUS_CODE (gst_rtsp_status_code_get_type())
+G_END_DECLS
+
+#endif /* __gst_rtsp_ENUM_TYPES_H__ */
+
+/* Generated data ends here */
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspbase64.c
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspbase64.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspbase64.c Wed Mar 24 18:04:17 2010 -0500
@@ -32,16 +32,6 @@
#include "gstrtspbase64.h"
-static char base64table[64] = {
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
- 'P',
- 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e',
- 'f',
- 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
- 'v',
- 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
-};
-
/**
* gst_rtsp_base64_encode:
* @data: the binary data to encode
@@ -49,48 +39,19 @@
*
* Encode a sequence of binary data into its Base-64 stringified representation.
*
+ * Deprecated: Use g_base64_encode()
+ *
* Returns: a newly allocated, zero-terminated Base-64 encoded string
* representing @data.
*/
/* This isn't efficient, but it doesn't need to be */
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
+#ifndef GST_REMOVE_DEPRECATED
gchar *
gst_rtsp_base64_encode (const gchar * data, gsize len)
{
- gchar *out = g_malloc (len * 4 / 3 + 4);
- gchar *result = out;
- int chunk;
-
- while (len > 0) {
- chunk = (len > 3) ? 3 : len;
- *out++ = base64table[(*data & 0xFC) >> 2];
- *out++ = base64table[((*data & 0x03) << 4) | ((*(data + 1) & 0xF0) >> 4)];
- switch (chunk) {
- case 3:
- *out++ =
- base64table[((*(data + 1) & 0x0F) << 2) | ((*(data +
- 2) & 0xC0) >> 6)];
- *out++ = base64table[(*(data + 2)) & 0x3F];
- break;
- case 2:
- *out++ = base64table[((*(data + 1) & 0x0F) << 2)];
- *out++ = '=';
- break;
- case 1:
- *out++ = '=';
- *out++ = '=';
- break;
- }
- data += chunk;
- len -= chunk;
- }
- *out = 0;
-
- return result;
+ return g_base64_encode ((const guchar *) data, len);
}
+#endif
/**
* gst_rtsp_base64_decode_ip:
@@ -100,51 +61,24 @@
* Decode the base64 string pointed to by @data in-place. When @len is not #NULL
* it will contain the length of the decoded data.
*/
+/* FIXME: Deprecate this once we depend on GLib 2.20 and
+ * use g_base64_decode_inplace then.
+ */
void
gst_rtsp_base64_decode_ip (gchar * data, gsize * len)
{
- char dtable[256];
- int i, j, k = 0, n = strlen (data);
+ gint input_length, output_length, state = 0;
+ guint save = 0;
- for (i = 0; i < 255; i++)
- dtable[i] = 0x80;
- for (i = 'A'; i <= 'Z'; i++)
- dtable[i] = 0 + (i - 'A');
- for (i = 'a'; i <= 'z'; i++)
- dtable[i] = 26 + (i - 'a');
- for (i = '0'; i <= '9'; i++)
- dtable[i] = 52 + (i - '0');
- dtable['+'] = 62;
- dtable['/'] = 63;
- dtable['='] = 0;
+ g_return_if_fail (data != NULL);
- for (j = 0; j < n; j += 4) {
- char a[4], b[4];
-
- for (i = 0; i < 4; i++) {
- int c = data[i + j];
+ input_length = strlen (data);
- if (dtable[c] & 0x80) {
- if (len)
- *len = 0;
- return;
- }
- a[i] = (char) c;
- b[i] = (char) dtable[c];
- }
- data[k++] = (b[0] << 2) | (b[1] >> 4);
- data[k++] = (b[1] << 4) | (b[2] >> 2);
- data[k++] = (b[2] << 6) | b[3];
- i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3);
- if (i < 3) {
- data[k] = 0;
- if (len)
- *len = k;
- return;
- }
- }
- data[k] = 0;
+ g_return_if_fail (input_length > 1);
+
+ output_length =
+ g_base64_decode_step (data, input_length, (guchar *) data, &state, &save);
+
if (len)
- *len = k;
- return;
+ *len = output_length;
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspbase64.h
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspbase64.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspbase64.h Wed Mar 24 18:04:17 2010 -0500
@@ -24,7 +24,10 @@
G_BEGIN_DECLS
+#ifndef GST_DISABLE_DEPRECATED
gchar *gst_rtsp_base64_encode (const gchar *data, gsize len);
+#endif
+
void gst_rtsp_base64_decode_ip (gchar *data, gsize *len);
G_END_DECLS
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspconnection.c
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspconnection.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspconnection.c Wed Mar 24 18:04:17 2010 -0500
@@ -1,5 +1,5 @@
/* GStreamer
- * Copyright (C) <2005,2006> Wim Taymans
+ * Copyright (C) <2005-2009> Wim Taymans
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -69,21 +69,25 @@
#include
#endif
-
/* we include this here to get the G_OS_* defines */
#include
#include
#ifdef G_OS_WIN32
+/* ws2_32.dll has getaddrinfo and freeaddrinfo on Windows XP and later.
+ * minwg32 headers check WINVER before allowing the use of these */
+#ifndef WINVER
+#define WINVER 0x0501
+#endif
#include
+#include
#define EINPROGRESS WSAEINPROGRESS
#else
#include
#include
#include
+#include
#include
-#include
-#include
#endif
#ifdef HAVE_FIONREAD_IN_SYS_FILIO
@@ -92,85 +96,709 @@
#include "gstrtspconnection.h"
#include "gstrtspbase64.h"
+#include "md5.h"
+
+union gst_sockaddr
+{
+ struct sockaddr sa;
+ struct sockaddr_in sa_in;
+ struct sockaddr_in6 sa_in6;
+ struct sockaddr_storage sa_stor;
+};
+
+typedef struct
+{
+ gint state;
+ guint save;
+ guchar out[3]; /* the size must be evenly divisible by 3 */
+ guint cout;
+ guint coutl;
+} DecodeCtx;
+
+static GstRTSPResult read_line (gint fd, guint8 * buffer, guint * idx,
+ guint size, DecodeCtx * ctxp);
+static GstRTSPResult parse_key_value (guint8 * buffer, gchar * key,
+ guint keysize, gchar ** value);
+static void parse_string (gchar * dest, gint size, gchar ** src);
#ifdef G_OS_WIN32
-#define FIONREAD_TYPE gulong
-#define IOCTL_SOCKET ioctlsocket
-#define READ_SOCKET(fd, buf, len) recv (fd, buf, len, 0)
-#define WRITE_SOCKET(fd, buf, len) send (fd, buf, len, 0)
+#define READ_SOCKET(fd, buf, len) recv (fd, (char *)buf, len, 0)
+#define WRITE_SOCKET(fd, buf, len) send (fd, (const char *)buf, len, 0)
+#define SETSOCKOPT(sock, level, name, val, len) setsockopt (sock, level, name, (const char *)val, len)
#define CLOSE_SOCKET(sock) closesocket (sock)
-#define ERRNO_IS_NOT_EAGAIN (WSAGetLastError () != WSAEWOULDBLOCK)
-#define ERRNO_IS_NOT_EINTR (WSAGetLastError () != WSAEINTR)
+#define ERRNO_IS_EAGAIN (WSAGetLastError () == WSAEWOULDBLOCK)
+#define ERRNO_IS_EINTR (WSAGetLastError () == WSAEINTR)
/* According to Microsoft's connect() documentation this one returns
* WSAEWOULDBLOCK and not WSAEINPROGRESS. */
-#define ERRNO_IS_NOT_EINPROGRESS (WSAGetLastError () != WSAEWOULDBLOCK)
+#define ERRNO_IS_EINPROGRESS (WSAGetLastError () == WSAEWOULDBLOCK)
#else
-#define FIONREAD_TYPE gint
-#define IOCTL_SOCKET ioctl
#define READ_SOCKET(fd, buf, len) read (fd, buf, len)
#define WRITE_SOCKET(fd, buf, len) write (fd, buf, len)
+#define SETSOCKOPT(sock, level, name, val, len) setsockopt (sock, level, name, val, len)
#define CLOSE_SOCKET(sock) close (sock)
-#define ERRNO_IS_NOT_EAGAIN (errno != EAGAIN)
-#define ERRNO_IS_NOT_EINTR (errno != EINTR)
-#define ERRNO_IS_NOT_EINPROGRESS (errno != EINPROGRESS)
+#define ERRNO_IS_EAGAIN (errno == EAGAIN)
+#define ERRNO_IS_EINTR (errno == EINTR)
+#define ERRNO_IS_EINPROGRESS (errno == EINPROGRESS)
#endif
-#ifdef G_OS_WIN32
-static int
-inet_aton (const char *c, struct in_addr *paddr)
+#define ADD_POLLFD(fdset, pfd, fd) \
+G_STMT_START { \
+ (pfd)->fd = fd; \
+ gst_poll_add_fd (fdset, pfd); \
+} G_STMT_END
+
+#define REMOVE_POLLFD(fdset, pfd) \
+G_STMT_START { \
+ if ((pfd)->fd != -1) { \
+ GST_DEBUG ("remove fd %d", (pfd)->fd); \
+ gst_poll_remove_fd (fdset, pfd); \
+ CLOSE_SOCKET ((pfd)->fd); \
+ (pfd)->fd = -1; \
+ } \
+} G_STMT_END
+
+typedef enum
+{
+ TUNNEL_STATE_NONE,
+ TUNNEL_STATE_GET,
+ TUNNEL_STATE_POST,
+ TUNNEL_STATE_COMPLETE
+} GstRTSPTunnelState;
+
+#define TUNNELID_LEN 24
+
+struct _GstRTSPConnection
{
- /* note that inet_addr is deprecated on unix because
- * inet_addr returns -1 (INADDR_NONE) for the valid 255.255.255.255
- * address. */
- paddr->s_addr = inet_addr (c);
-
- if (paddr->s_addr == INADDR_NONE)
- return 0;
-
- return 1;
+ /*< private > */
+ /* URL for the connection */
+ GstRTSPUrl *url;
+
+ /* connection state */
+ GstPollFD fd0;
+ GstPollFD fd1;
+
+ GstPollFD *readfd;
+ GstPollFD *writefd;
+
+ gchar tunnelid[TUNNELID_LEN];
+ gboolean tunneled;
+ GstRTSPTunnelState tstate;
+
+ GstPoll *fdset;
+ gchar *ip;
+
+ /* Session state */
+ gint cseq; /* sequence number */
+ gchar session_id[512]; /* session id */
+ gint timeout; /* session timeout in seconds */
+ GTimer *timer; /* timeout timer */
+
+ /* Authentication */
+ GstRTSPAuthMethod auth_method;
+ gchar *username;
+ gchar *passwd;
+ GHashTable *auth_params;
+
+ DecodeCtx ctx;
+ DecodeCtx *ctxp;
+
+ gchar *proxy_host;
+ guint proxy_port;
+};
+
+enum
+{
+ STATE_START = 0,
+ STATE_DATA_HEADER,
+ STATE_DATA_BODY,
+ STATE_READ_LINES,
+ STATE_END,
+ STATE_LAST
+};
+
+/* a structure for constructing RTSPMessages */
+typedef struct
+{
+ gint state;
+ guint8 buffer[4096];
+ guint offset;
+
+ guint line;
+ guint8 *body_data;
+ glong body_len;
+} GstRTSPBuilder;
+
+static void
+build_reset (GstRTSPBuilder * builder)
+{
+ g_free (builder->body_data);
+ memset (builder, 0, sizeof (GstRTSPBuilder));
}
-#endif
/**
* gst_rtsp_connection_create:
* @url: a #GstRTSPUrl
- * @conn: a #GstRTSPConnection
+ * @conn: storage for a #GstRTSPConnection
*
* Create a newly allocated #GstRTSPConnection from @url and store it in @conn.
* The connection will not yet attempt to connect to @url, use
* gst_rtsp_connection_connect().
*
+ * A copy of @url will be made.
+ *
* Returns: #GST_RTSP_OK when @conn contains a valid connection.
*/
GstRTSPResult
-gst_rtsp_connection_create (GstRTSPUrl * url, GstRTSPConnection ** conn)
+gst_rtsp_connection_create (const GstRTSPUrl * url, GstRTSPConnection ** conn)
{
GstRTSPConnection *newconn;
+#ifdef G_OS_WIN32
+ WSADATA w;
+ int error;
+#endif
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
+#ifdef G_OS_WIN32
+ error = WSAStartup (0x0202, &w);
+
+ if (error)
+ goto startup_error;
+
+ if (w.wVersion != 0x0202)
+ goto version_error;
+#endif
+
newconn = g_new0 (GstRTSPConnection, 1);
if ((newconn->fdset = gst_poll_new (TRUE)) == NULL)
goto no_fdset;
- newconn->url = url;
- newconn->fd.fd = -1;
+ newconn->url = gst_rtsp_url_copy (url);
+ newconn->fd0.fd = -1;
+ newconn->fd1.fd = -1;
newconn->timer = g_timer_new ();
+ newconn->timeout = 60;
+ newconn->cseq = 1;
newconn->auth_method = GST_RTSP_AUTH_NONE;
newconn->username = NULL;
newconn->passwd = NULL;
+ newconn->auth_params = NULL;
+
+ *conn = newconn;
+
+ return GST_RTSP_OK;
+
+ /* ERRORS */
+#ifdef G_OS_WIN32
+startup_error:
+ {
+ g_warning ("Error %d on WSAStartup", error);
+ return GST_RTSP_EWSASTART;
+ }
+version_error:
+ {
+ g_warning ("Windows sockets are not version 0x202 (current 0x%x)",
+ w.wVersion);
+ WSACleanup ();
+ return GST_RTSP_EWSAVERSION;
+ }
+#endif
+no_fdset:
+ {
+ g_free (newconn);
+#ifdef G_OS_WIN32
+ WSACleanup ();
+#endif
+ return GST_RTSP_ESYS;
+ }
+}
+
+/**
+ * gst_rtsp_connection_accept:
+ * @sock: a socket
+ * @conn: storage for a #GstRTSPConnection
+ *
+ * Accept a new connection on @sock and create a new #GstRTSPConnection for
+ * handling communication on new socket.
+ *
+ * Returns: #GST_RTSP_OK when @conn contains a valid connection.
+ *
+ * Since: 0.10.23
+ */
+GstRTSPResult
+gst_rtsp_connection_accept (gint sock, GstRTSPConnection ** conn)
+{
+ int fd;
+ GstRTSPConnection *newconn = NULL;
+ union gst_sockaddr sa;
+ socklen_t slen = sizeof (sa);
+ gchar ip[INET6_ADDRSTRLEN];
+ GstRTSPUrl *url;
+#ifdef G_OS_WIN32
+ gulong flags = 1;
+#endif
+
+ memset (&sa, 0, slen);
+
+#ifndef G_OS_WIN32
+ fd = accept (sock, &sa.sa, &slen);
+#else
+ fd = accept (sock, &sa.sa, (gint *) & slen);
+#endif /* G_OS_WIN32 */
+ if (fd == -1)
+ goto accept_failed;
+
+ if (getnameinfo (&sa.sa, slen, ip, sizeof (ip), NULL, 0, NI_NUMERICHOST) != 0)
+ goto getnameinfo_failed;
+ if (sa.sa.sa_family != AF_INET && sa.sa.sa_family != AF_INET6)
+ goto wrong_family;
+
+ /* set to non-blocking mode so that we can cancel the communication */
+#ifndef G_OS_WIN32
+ fcntl (fd, F_SETFL, O_NONBLOCK);
+#else
+ ioctlsocket (fd, FIONBIO, &flags);
+#endif /* G_OS_WIN32 */
+
+ /* create a url for the client address */
+ url = g_new0 (GstRTSPUrl, 1);
+ url->host = g_strdup (ip);
+ if (sa.sa.sa_family == AF_INET)
+ url->port = sa.sa_in.sin_port;
+ else
+ url->port = sa.sa_in6.sin6_port;
+
+ /* now create the connection object */
+ gst_rtsp_connection_create (url, &newconn);
+ gst_rtsp_url_free (url);
+
+ ADD_POLLFD (newconn->fdset, &newconn->fd0, fd);
+
+ /* both read and write initially */
+ newconn->readfd = &newconn->fd0;
+ newconn->writefd = &newconn->fd0;
*conn = newconn;
return GST_RTSP_OK;
/* ERRORS */
-no_fdset:
+accept_failed:
+ {
+ return GST_RTSP_ESYS;
+ }
+getnameinfo_failed:
+wrong_family:
+ {
+ close (fd);
+ return GST_RTSP_ERROR;
+ }
+}
+
+static gchar *
+do_resolve (const gchar * host)
+{
+ static gchar ip[INET6_ADDRSTRLEN];
+ struct addrinfo *aires;
+ struct addrinfo *ai;
+ gint aierr;
+
+ aierr = getaddrinfo (host, NULL, NULL, &aires);
+ if (aierr != 0)
+ goto no_addrinfo;
+
+ for (ai = aires; ai; ai = ai->ai_next) {
+ if (ai->ai_family == AF_INET || ai->ai_family == AF_INET6) {
+ break;
+ }
+ }
+ if (ai == NULL)
+ goto no_family;
+
+ aierr = getnameinfo (ai->ai_addr, ai->ai_addrlen, ip, sizeof (ip), NULL, 0,
+ NI_NUMERICHOST | NI_NUMERICSERV);
+ if (aierr != 0)
+ goto no_address;
+
+ freeaddrinfo (aires);
+
+ return g_strdup (ip);
+
+ /* ERRORS */
+no_addrinfo:
+ {
+ GST_ERROR ("no addrinfo found for %s: %s", host, gai_strerror (aierr));
+ return NULL;
+ }
+no_family:
+ {
+ GST_ERROR ("no family found for %s", host);
+ freeaddrinfo (aires);
+ return NULL;
+ }
+no_address:
+ {
+ GST_ERROR ("no address found for %s: %s", host, gai_strerror (aierr));
+ freeaddrinfo (aires);
+ return NULL;
+ }
+}
+
+static GstRTSPResult
+do_connect (const gchar * ip, guint16 port, GstPollFD * fdout,
+ GstPoll * fdset, GTimeVal * timeout)
+{
+ gint fd;
+ struct addrinfo hints;
+ struct addrinfo *aires;
+ struct addrinfo *ai;
+ gint aierr;
+ gchar service[NI_MAXSERV];
+ gint ret;
+#ifdef G_OS_WIN32
+ unsigned long flags = 1;
+#endif /* G_OS_WIN32 */
+ GstClockTime to;
+ gint retval;
+
+ memset (&hints, 0, sizeof hints);
+ hints.ai_flags = AI_NUMERICHOST;
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ g_snprintf (service, sizeof (service) - 1, "%hu", port);
+ service[sizeof (service) - 1] = '\0';
+
+ aierr = getaddrinfo (ip, service, &hints, &aires);
+ if (aierr != 0)
+ goto no_addrinfo;
+
+ for (ai = aires; ai; ai = ai->ai_next) {
+ if (ai->ai_family == AF_INET || ai->ai_family == AF_INET6) {
+ break;
+ }
+ }
+ if (ai == NULL)
+ goto no_family;
+
+ fd = socket (ai->ai_family, SOCK_STREAM, 0);
+ if (fd == -1)
+ goto no_socket;
+
+ /* set to non-blocking mode so that we can cancel the connect */
+#ifndef G_OS_WIN32
+ fcntl (fd, F_SETFL, O_NONBLOCK);
+#else
+ ioctlsocket (fd, FIONBIO, &flags);
+#endif /* G_OS_WIN32 */
+
+ /* add the socket to our fdset */
+ ADD_POLLFD (fdset, fdout, fd);
+
+ /* we are going to connect ASYNC now */
+ ret = connect (fd, ai->ai_addr, ai->ai_addrlen);
+ if (ret == 0)
+ goto done;
+ if (!ERRNO_IS_EINPROGRESS)
+ goto sys_error;
+
+ /* wait for connect to complete up to the specified timeout or until we got
+ * interrupted. */
+ gst_poll_fd_ctl_write (fdset, fdout, TRUE);
+
+ to = timeout ? GST_TIMEVAL_TO_TIME (*timeout) : GST_CLOCK_TIME_NONE;
+
+ do {
+ retval = gst_poll_wait (fdset, to);
+ } while (retval == -1 && (errno == EINTR || errno == EAGAIN));
+
+ if (retval == 0)
+ goto timeout;
+ else if (retval == -1)
+ goto sys_error;
+
+ /* we can still have an error connecting on windows */
+ if (gst_poll_fd_has_error (fdset, fdout)) {
+ socklen_t len = sizeof (errno);
+#ifndef G_OS_WIN32
+ getsockopt (fd, SOL_SOCKET, SO_ERROR, &errno, &len);
+#else
+ getsockopt (fd, SOL_SOCKET, SO_ERROR, (char *) &errno, &len);
+#endif
+ goto sys_error;
+ }
+
+ gst_poll_fd_ignored (fdset, fdout);
+
+done:
+ freeaddrinfo (aires);
+
+ return GST_RTSP_OK;
+
+ /* ERRORS */
+no_addrinfo:
+ {
+ GST_ERROR ("no addrinfo found for %s: %s", ip, gai_strerror (aierr));
+ return GST_RTSP_ERROR;
+ }
+no_family:
+ {
+ GST_ERROR ("no family found for %s", ip);
+ freeaddrinfo (aires);
+ return GST_RTSP_ERROR;
+ }
+no_socket:
+ {
+ GST_ERROR ("no socket %d (%s)", errno, g_strerror (errno));
+ freeaddrinfo (aires);
+ return GST_RTSP_ESYS;
+ }
+sys_error:
+ {
+ GST_ERROR ("system error %d (%s)", errno, g_strerror (errno));
+ REMOVE_POLLFD (fdset, fdout);
+ freeaddrinfo (aires);
+ return GST_RTSP_ESYS;
+ }
+timeout:
{
- g_free (newconn);
- return GST_RTSP_ESYS;
+ GST_ERROR ("timeout");
+ REMOVE_POLLFD (fdset, fdout);
+ freeaddrinfo (aires);
+ return GST_RTSP_ETIMEOUT;
+ }
+}
+
+static GstRTSPResult
+setup_tunneling (GstRTSPConnection * conn, GTimeVal * timeout)
+{
+ gint i;
+ GstRTSPResult res;
+ gchar *str;
+ guint idx, line;
+ gint retval;
+ GstClockTime to;
+ gchar *ip, *url_port_str;
+ guint16 port, url_port;
+ gchar codestr[4], *resultstr;
+ gint code;
+ GstRTSPUrl *url;
+ gchar *hostparam;
+
+ /* create a random sessionid */
+ for (i = 0; i < TUNNELID_LEN; i++)
+ conn->tunnelid[i] = g_random_int_range ('a', 'z');
+ conn->tunnelid[TUNNELID_LEN - 1] = '\0';
+
+ url = conn->url;
+ /* get the port from the url */
+ gst_rtsp_url_get_port (url, &url_port);
+
+ if (conn->proxy_host) {
+ hostparam = g_strdup_printf ("Host: %s:%d\r\n", url->host, url_port);
+ url_port_str = g_strdup_printf (":%d", url_port);
+ ip = conn->proxy_host;
+ port = conn->proxy_port;
+ } else {
+ hostparam = NULL;
+ url_port_str = NULL;
+ ip = conn->ip;
+ port = url_port;
+ }
+
+ /* */
+ str = g_strdup_printf ("GET %s%s%s%s%s%s HTTP/1.0\r\n"
+ "%s"
+ "x-sessioncookie: %s\r\n"
+ "Accept: application/x-rtsp-tunnelled\r\n"
+ "Pragma: no-cache\r\n"
+ "Cache-Control: no-cache\r\n" "\r\n",
+ conn->proxy_host ? "http://" : "",
+ conn->proxy_host ? url->host : "",
+ conn->proxy_host ? url_port_str : "",
+ url->abspath, url->query ? "?" : "", url->query ? url->query : "",
+ hostparam ? hostparam : "", conn->tunnelid);
+
+ /* we start by writing to this fd */
+ conn->writefd = &conn->fd0;
+
+ res = gst_rtsp_connection_write (conn, (guint8 *) str, strlen (str), timeout);
+ g_free (str);
+ if (res != GST_RTSP_OK)
+ goto write_failed;
+
+ gst_poll_fd_ctl_write (conn->fdset, &conn->fd0, FALSE);
+ gst_poll_fd_ctl_read (conn->fdset, &conn->fd0, TRUE);
+
+ to = timeout ? GST_TIMEVAL_TO_TIME (*timeout) : GST_CLOCK_TIME_NONE;
+
+ line = 0;
+ while (TRUE) {
+ guint8 buffer[4096];
+
+ idx = 0;
+ while (TRUE) {
+ res = read_line (conn->fd0.fd, buffer, &idx, sizeof (buffer), NULL);
+ if (res == GST_RTSP_EEOF)
+ goto eof;
+ if (res == GST_RTSP_OK)
+ break;
+ if (res != GST_RTSP_EINTR)
+ goto read_error;
+
+ do {
+ retval = gst_poll_wait (conn->fdset, to);
+ } while (retval == -1 && (errno == EINTR || errno == EAGAIN));
+
+ /* check for timeout */
+ if (retval == 0)
+ goto timeout;
+
+ if (retval == -1) {
+ if (errno == EBUSY)
+ goto stopped;
+ else
+ goto select_error;
+ }
+ }
+
+ /* check for last line */
+ if (buffer[0] == '\r')
+ buffer[0] = '\0';
+ if (buffer[0] == '\0')
+ break;
+
+ if (line == 0) {
+ /* first line, parse response */
+ gchar versionstr[20];
+ gchar *bptr;
+
+ bptr = (gchar *) buffer;
+
+ parse_string (versionstr, sizeof (versionstr), &bptr);
+ parse_string (codestr, sizeof (codestr), &bptr);
+ code = atoi (codestr);
+
+ while (g_ascii_isspace (*bptr))
+ bptr++;
+
+ resultstr = bptr;
+
+ if (code != GST_RTSP_STS_OK)
+ goto wrong_result;
+ } else {
+ gchar key[32];
+ gchar *value;
+
+ /* other lines, parse key/value */
+ res = parse_key_value (buffer, key, sizeof (key), &value);
+ if (res == GST_RTSP_OK) {
+ /* we got a new ip address */
+ if (g_ascii_strcasecmp (key, "x-server-ip-address") == 0) {
+ if (conn->proxy_host) {
+ /* if we use a proxy we need to change the destination url */
+ g_free (url->host);
+ url->host = g_strdup (value);
+ g_free (hostparam);
+ g_free (url_port_str);
+ hostparam =
+ g_strdup_printf ("Host: %s:%d\r\n", url->host, url_port);
+ url_port_str = g_strdup_printf (":%d", url_port);
+ } else {
+ /* and resolve the new ip address */
+ if (!(ip = do_resolve (conn->ip)))
+ goto not_resolved;
+ g_free (conn->ip);
+ conn->ip = ip;
+ }
+ }
+ }
+ }
+ line++;
+ }
+
+ /* connect to the host/port */
+ res = do_connect (ip, port, &conn->fd1, conn->fdset, timeout);
+ if (res != GST_RTSP_OK)
+ goto connect_failed;
+
+ /* this is now our writing socket */
+ conn->writefd = &conn->fd1;
+
+ /* */
+ str = g_strdup_printf ("POST %s%s%s%s%s%s HTTP/1.0\r\n"
+ "%s"
+ "x-sessioncookie: %s\r\n"
+ "Content-Type: application/x-rtsp-tunnelled\r\n"
+ "Pragma: no-cache\r\n"
+ "Cache-Control: no-cache\r\n"
+ "Content-Length: 32767\r\n"
+ "Expires: Sun, 9 Jan 1972 00:00:00 GMT\r\n"
+ "\r\n",
+ conn->proxy_host ? "http://" : "",
+ conn->proxy_host ? url->host : "",
+ conn->proxy_host ? url_port_str : "",
+ url->abspath, url->query ? "?" : "", url->query ? url->query : "",
+ hostparam ? hostparam : "", conn->tunnelid);
+
+ res = gst_rtsp_connection_write (conn, (guint8 *) str, strlen (str), timeout);
+ g_free (str);
+ if (res != GST_RTSP_OK)
+ goto write_failed;
+
+exit:
+ g_free (hostparam);
+ g_free (url_port_str);
+
+ return res;
+
+ /* ERRORS */
+write_failed:
+ {
+ GST_ERROR ("write failed (%d)", res);
+ goto exit;
+ }
+eof:
+ {
+ res = GST_RTSP_EEOF;
+ goto exit;
+ }
+read_error:
+ {
+ goto exit;
+ }
+timeout:
+ {
+ res = GST_RTSP_ETIMEOUT;
+ goto exit;
+ }
+select_error:
+ {
+ res = GST_RTSP_ESYS;
+ goto exit;
+ }
+stopped:
+ {
+ res = GST_RTSP_EINTR;
+ goto exit;
+ }
+wrong_result:
+ {
+ GST_ERROR ("got failure response %d %s", code, resultstr);
+ res = GST_RTSP_ERROR;
+ goto exit;
+ }
+not_resolved:
+ {
+ GST_ERROR ("could not resolve %s", conn->ip);
+ res = GST_RTSP_ENET;
+ goto exit;
+ }
+connect_failed:
+ {
+ GST_ERROR ("failed to connect");
+ goto exit;
}
}
@@ -191,132 +819,128 @@
GstRTSPResult
gst_rtsp_connection_connect (GstRTSPConnection * conn, GTimeVal * timeout)
{
- gint fd;
- struct sockaddr_in sa_in;
- struct hostent *hostinfo;
- const gchar *ip;
- struct in_addr addr;
- gint ret;
+ GstRTSPResult res;
+ gchar *ip;
guint16 port;
GstRTSPUrl *url;
- GstClockTime to;
- gint retval;
-
-#ifdef G_OS_WIN32
- unsigned long flags = 1;
- struct in_addr *addrp;
-#else
- char **addrs;
- gchar ipbuf[INET_ADDRSTRLEN];
-#endif /* G_OS_WIN32 */
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (conn->url != NULL, GST_RTSP_EINVAL);
- g_return_val_if_fail (conn->fd.fd < 0, GST_RTSP_EINVAL);
+ g_return_val_if_fail (conn->fd0.fd < 0, GST_RTSP_EINVAL);
url = conn->url;
- /* first check if it already is an IP address */
- if (inet_aton (url->host, &addr)) {
- ip = url->host;
+ if (conn->proxy_host && conn->tunneled) {
+ if (!(ip = do_resolve (conn->proxy_host))) {
+ GST_ERROR ("could not resolve %s", conn->proxy_host);
+ goto not_resolved;
+ }
+ port = conn->proxy_port;
+ g_free (conn->proxy_host);
+ conn->proxy_host = ip;
} else {
- hostinfo = gethostbyname (url->host);
- if (!hostinfo)
- goto not_resolved; /* h_errno set */
-
- if (hostinfo->h_addrtype != AF_INET)
- goto not_ip; /* host not an IP host */
-#ifdef G_OS_WIN32
- addrp = (struct in_addr *) hostinfo->h_addr_list[0];
- /* this is not threadsafe */
- ip = inet_ntoa (*addrp);
-#else
- addrs = hostinfo->h_addr_list;
- ip = inet_ntop (AF_INET, (struct in_addr *) addrs[0], ipbuf,
- sizeof (ipbuf));
-#endif /* G_OS_WIN32 */
+ if (!(ip = do_resolve (url->host))) {
+ GST_ERROR ("could not resolve %s", url->host);
+ goto not_resolved;
+ }
+ /* get the port from the url */
+ gst_rtsp_url_get_port (url, &port);
+
+ g_free (conn->ip);
+ conn->ip = ip;
}
- /* get the port from the url */
- gst_rtsp_url_get_port (url, &port);
-
- memset (&sa_in, 0, sizeof (sa_in));
- sa_in.sin_family = AF_INET; /* network socket */
- sa_in.sin_port = htons (port); /* on port */
- sa_in.sin_addr.s_addr = inet_addr (ip); /* on host ip */
-
- fd = socket (AF_INET, SOCK_STREAM, 0);
- if (fd == -1)
- goto sys_error;
-
- /* set to non-blocking mode so that we can cancel the connect */
-#ifndef G_OS_WIN32
- fcntl (fd, F_SETFL, O_NONBLOCK);
-#else
- ioctlsocket (fd, FIONBIO, &flags);
-#endif /* G_OS_WIN32 */
-
- /* add the socket to our fdset */
- conn->fd.fd = fd;
- gst_poll_add_fd (conn->fdset, &conn->fd);
-
- /* we are going to connect ASYNC now */
- ret = connect (fd, (struct sockaddr *) &sa_in, sizeof (sa_in));
- if (ret == 0)
- goto done;
- if (ERRNO_IS_NOT_EINPROGRESS)
- goto sys_error;
-
- /* wait for connect to complete up to the specified timeout or until we got
- * interrupted. */
- gst_poll_fd_ctl_write (conn->fdset, &conn->fd, TRUE);
-
- to = timeout ? GST_TIMEVAL_TO_TIME (*timeout) : GST_CLOCK_TIME_NONE;
-
- do {
- retval = gst_poll_wait (conn->fdset, to);
- } while (retval == -1 && (errno == EINTR || errno == EAGAIN));
-
- if (retval == 0)
- goto timeout;
- else if (retval == -1)
- goto sys_error;
-
- gst_poll_fd_ignored (conn->fdset, &conn->fd);
-
-done:
- conn->ip = g_strdup (ip);
+ /* connect to the host/port */
+ res = do_connect (ip, port, &conn->fd0, conn->fdset, timeout);
+ if (res != GST_RTSP_OK)
+ goto connect_failed;
+
+ /* this is our read URL */
+ conn->readfd = &conn->fd0;
+
+ if (conn->tunneled) {
+ res = setup_tunneling (conn, timeout);
+ if (res != GST_RTSP_OK)
+ goto tunneling_failed;
+ } else {
+ conn->writefd = &conn->fd0;
+ }
return GST_RTSP_OK;
-sys_error:
- {
- if (conn->fd.fd >= 0) {
- gst_poll_remove_fd (conn->fdset, &conn->fd);
- conn->fd.fd = -1;
- }
- if (fd >= 0)
- CLOSE_SOCKET (fd);
- return GST_RTSP_ESYS;
- }
not_resolved:
{
return GST_RTSP_ENET;
}
-not_ip:
+connect_failed:
{
- return GST_RTSP_ENOTIP;
+ GST_ERROR ("failed to connect");
+ return res;
}
-timeout:
+tunneling_failed:
{
- if (conn->fd.fd >= 0) {
- gst_poll_remove_fd (conn->fdset, &conn->fd);
- conn->fd.fd = -1;
- }
- if (fd >= 0)
- CLOSE_SOCKET (fd);
- return GST_RTSP_ETIMEOUT;
+ GST_ERROR ("failed to setup tunneling");
+ return res;
+ }
+}
+
+static void
+md5_digest_to_hex_string (unsigned char digest[16], char string[33])
+{
+ static const char hexdigits[] = "0123456789abcdef";
+ int i;
+
+ for (i = 0; i < 16; i++) {
+ string[i * 2] = hexdigits[(digest[i] >> 4) & 0x0f];
+ string[i * 2 + 1] = hexdigits[digest[i] & 0x0f];
}
+ string[32] = 0;
+}
+
+static void
+auth_digest_compute_hex_urp (const gchar * username,
+ const gchar * realm, const gchar * password, gchar hex_urp[33])
+{
+ struct MD5Context md5_context;
+ unsigned char digest[16];
+
+ MD5Init (&md5_context);
+ MD5Update (&md5_context, username, strlen (username));
+ MD5Update (&md5_context, ":", 1);
+ MD5Update (&md5_context, realm, strlen (realm));
+ MD5Update (&md5_context, ":", 1);
+ MD5Update (&md5_context, password, strlen (password));
+ MD5Final (digest, &md5_context);
+ md5_digest_to_hex_string (digest, hex_urp);
+}
+
+static void
+auth_digest_compute_response (const gchar * method,
+ const gchar * uri, const gchar * hex_a1, const gchar * nonce,
+ gchar response[33])
+{
+ char hex_a2[33];
+ struct MD5Context md5_context;
+ unsigned char digest[16];
+
+ /* compute A2 */
+ MD5Init (&md5_context);
+ MD5Update (&md5_context, method, strlen (method));
+ MD5Update (&md5_context, ":", 1);
+ MD5Update (&md5_context, uri, strlen (uri));
+ MD5Final (digest, &md5_context);
+ md5_digest_to_hex_string (digest, hex_a2);
+
+ /* compute KD */
+ MD5Init (&md5_context);
+ MD5Update (&md5_context, hex_a1, strlen (hex_a1));
+ MD5Update (&md5_context, ":", 1);
+ MD5Update (&md5_context, nonce, strlen (nonce));
+ MD5Update (&md5_context, ":", 1);
+
+ MD5Update (&md5_context, hex_a2, 32);
+ MD5Final (digest, &md5_context);
+ md5_digest_to_hex_string (digest, response);
}
static void
@@ -324,18 +948,62 @@
{
switch (conn->auth_method) {
case GST_RTSP_AUTH_BASIC:{
- gchar *user_pass =
- g_strdup_printf ("%s:%s", conn->username, conn->passwd);
- gchar *user_pass64 =
- gst_rtsp_base64_encode (user_pass, strlen (user_pass));
- gchar *auth_string = g_strdup_printf ("Basic %s", user_pass64);
-
- gst_rtsp_message_add_header (message, GST_RTSP_HDR_AUTHORIZATION,
+ gchar *user_pass;
+ gchar *user_pass64;
+ gchar *auth_string;
+
+ user_pass = g_strdup_printf ("%s:%s", conn->username, conn->passwd);
+ user_pass64 = g_base64_encode ((guchar *) user_pass, strlen (user_pass));
+ auth_string = g_strdup_printf ("Basic %s", user_pass64);
+
+ gst_rtsp_message_take_header (message, GST_RTSP_HDR_AUTHORIZATION,
auth_string);
g_free (user_pass);
g_free (user_pass64);
- g_free (auth_string);
+ break;
+ }
+ case GST_RTSP_AUTH_DIGEST:{
+ gchar response[33], hex_urp[33];
+ gchar *auth_string, *auth_string2;
+ gchar *realm;
+ gchar *nonce;
+ gchar *opaque;
+ const gchar *uri;
+ const gchar *method;
+
+ /* we need to have some params set */
+ if (conn->auth_params == NULL)
+ break;
+
+ /* we need the realm and nonce */
+ realm = (gchar *) g_hash_table_lookup (conn->auth_params, "realm");
+ nonce = (gchar *) g_hash_table_lookup (conn->auth_params, "nonce");
+ if (realm == NULL || nonce == NULL)
+ break;
+
+ auth_digest_compute_hex_urp (conn->username, realm, conn->passwd,
+ hex_urp);
+
+ method = gst_rtsp_method_as_text (message->type_data.request.method);
+ uri = message->type_data.request.uri;
+
+ /* Assume no qop, algorithm=md5, stale=false */
+ /* For algorithm MD5, a1 = urp. */
+ auth_digest_compute_response (method, uri, hex_urp, nonce, response);
+ auth_string = g_strdup_printf ("Digest username=\"%s\", "
+ "realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\"",
+ conn->username, realm, nonce, uri, response);
+
+ opaque = (gchar *) g_hash_table_lookup (conn->auth_params, "opaque");
+ if (opaque) {
+ auth_string2 = g_strdup_printf ("%s, opaque=\"%s\"", auth_string,
+ opaque);
+ g_free (auth_string);
+ auth_string = auth_string2;
+ }
+ gst_rtsp_message_take_header (message, GST_RTSP_HDR_AUTHORIZATION,
+ auth_string);
break;
}
default:
@@ -345,12 +1013,10 @@
}
static void
-add_date_header (GstRTSPMessage * message)
+gen_date_string (gchar * date_string, guint len)
{
GTimeVal tv;
- gchar date_string[100];
time_t t;
-
#ifdef HAVE_GMTIME_R
struct tm tm_;
#endif
@@ -359,14 +1025,139 @@
t = (time_t) tv.tv_sec;
#ifdef HAVE_GMTIME_R
- strftime (date_string, sizeof (date_string), "%a, %d %b %Y %H:%M:%S GMT",
- gmtime_r (&t, &tm_));
+ strftime (date_string, len, "%a, %d %b %Y %H:%M:%S GMT", gmtime_r (&t, &tm_));
#else
- strftime (date_string, sizeof (date_string), "%a, %d %b %Y %H:%M:%S GMT",
- gmtime (&t));
+ strftime (date_string, len, "%a, %d %b %Y %H:%M:%S GMT", gmtime (&t));
#endif
-
- gst_rtsp_message_add_header (message, GST_RTSP_HDR_DATE, date_string);
+}
+
+static GstRTSPResult
+write_bytes (gint fd, const guint8 * buffer, guint * idx, guint size)
+{
+ guint left;
+
+ if (G_UNLIKELY (*idx > size))
+ return GST_RTSP_ERROR;
+
+ left = size - *idx;
+
+ while (left) {
+ gint r;
+
+ r = WRITE_SOCKET (fd, &buffer[*idx], left);
+ if (G_UNLIKELY (r == 0)) {
+ return GST_RTSP_EINTR;
+ } else if (G_UNLIKELY (r < 0)) {
+ if (ERRNO_IS_EAGAIN)
+ return GST_RTSP_EINTR;
+ if (!ERRNO_IS_EINTR)
+ return GST_RTSP_ESYS;
+ } else {
+ left -= r;
+ *idx += r;
+ }
+ }
+ return GST_RTSP_OK;
+}
+
+static gint
+fill_bytes (gint fd, guint8 * buffer, guint size, DecodeCtx * ctx)
+{
+ gint out = 0;
+
+ if (ctx) {
+ while (size > 0) {
+ guint8 in[sizeof (ctx->out) * 4 / 3];
+ gint r;
+
+ while (size > 0 && ctx->cout < ctx->coutl) {
+ /* we have some leftover bytes */
+ *buffer++ = ctx->out[ctx->cout++];
+ size--;
+ out++;
+ }
+
+ /* got what we needed? */
+ if (size == 0)
+ break;
+
+ /* try to read more bytes */
+ r = READ_SOCKET (fd, in, sizeof (in));
+ if (r <= 0) {
+ if (out == 0)
+ out = r;
+ break;
+ }
+
+ ctx->cout = 0;
+ ctx->coutl =
+ g_base64_decode_step ((gchar *) in, r, ctx->out, &ctx->state,
+ &ctx->save);
+ }
+ } else {
+ out = READ_SOCKET (fd, buffer, size);
+ }
+
+ return out;
+}
+
+static GstRTSPResult
+read_bytes (gint fd, guint8 * buffer, guint * idx, guint size, DecodeCtx * ctx)
+{
+ guint left;
+
+ if (G_UNLIKELY (*idx > size))
+ return GST_RTSP_ERROR;
+
+ left = size - *idx;
+
+ while (left) {
+ gint r;
+
+ r = fill_bytes (fd, &buffer[*idx], left, ctx);
+ if (G_UNLIKELY (r == 0)) {
+ return GST_RTSP_EEOF;
+ } else if (G_UNLIKELY (r < 0)) {
+ if (ERRNO_IS_EAGAIN)
+ return GST_RTSP_EINTR;
+ if (!ERRNO_IS_EINTR)
+ return GST_RTSP_ESYS;
+ } else {
+ left -= r;
+ *idx += r;
+ }
+ }
+ return GST_RTSP_OK;
+}
+
+static GstRTSPResult
+read_line (gint fd, guint8 * buffer, guint * idx, guint size, DecodeCtx * ctx)
+{
+ while (TRUE) {
+ guint8 c;
+ gint r;
+
+ r = fill_bytes (fd, &c, 1, ctx);
+ if (G_UNLIKELY (r == 0)) {
+ return GST_RTSP_EEOF;
+ } else if (G_UNLIKELY (r < 0)) {
+ if (ERRNO_IS_EAGAIN)
+ return GST_RTSP_EINTR;
+ if (!ERRNO_IS_EINTR)
+ return GST_RTSP_ESYS;
+ } else {
+ if (c == '\n') /* end on \n */
+ break;
+ if (c == '\r') /* ignore \r */
+ continue;
+
+ if (G_LIKELY (*idx < size - 1))
+ buffer[(*idx)++] = c;
+ }
+ }
+ buffer[*idx] = '\0';
+
+ return GST_RTSP_OK;
}
/**
@@ -388,47 +1179,48 @@
gst_rtsp_connection_write (GstRTSPConnection * conn, const guint8 * data,
guint size, GTimeVal * timeout)
{
- guint towrite;
+ guint offset;
gint retval;
GstClockTime to;
+ GstRTSPResult res;
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (data != NULL || size == 0, GST_RTSP_EINVAL);
+ g_return_val_if_fail (conn->writefd != NULL, GST_RTSP_EINVAL);
gst_poll_set_controllable (conn->fdset, TRUE);
- gst_poll_fd_ctl_write (conn->fdset, &conn->fd, TRUE);
- gst_poll_fd_ctl_read (conn->fdset, &conn->fd, FALSE);
+ gst_poll_fd_ctl_write (conn->fdset, conn->writefd, TRUE);
+ gst_poll_fd_ctl_read (conn->fdset, conn->readfd, FALSE);
+ /* clear all previous poll results */
+ gst_poll_fd_ignored (conn->fdset, conn->writefd);
+ gst_poll_fd_ignored (conn->fdset, conn->readfd);
to = timeout ? GST_TIMEVAL_TO_TIME (*timeout) : GST_CLOCK_TIME_NONE;
- towrite = size;
-
- while (towrite > 0) {
- gint written;
-
+ offset = 0;
+
+ while (TRUE) {
+ /* try to write */
+ res = write_bytes (conn->writefd->fd, data, &offset, size);
+ if (G_LIKELY (res == GST_RTSP_OK))
+ break;
+ if (G_UNLIKELY (res != GST_RTSP_EINTR))
+ goto write_error;
+
+ /* not all is written, wait until we can write more */
do {
retval = gst_poll_wait (conn->fdset, to);
} while (retval == -1 && (errno == EINTR || errno == EAGAIN));
- if (retval == 0)
+ if (G_UNLIKELY (retval == 0))
goto timeout;
- if (retval == -1) {
+ if (G_UNLIKELY (retval == -1)) {
if (errno == EBUSY)
goto stopped;
else
goto select_error;
}
-
- /* now we can write */
- written = WRITE_SOCKET (conn->fd.fd, data, towrite);
- if (written < 0) {
- if (ERRNO_IS_NOT_EAGAIN && ERRNO_IS_NOT_EINTR)
- goto write_error;
- } else {
- towrite -= written;
- data += written;
- }
}
return GST_RTSP_OK;
@@ -447,48 +1239,14 @@
}
write_error:
{
- return GST_RTSP_ESYS;
+ return res;
}
}
-/**
- * gst_rtsp_connection_send:
- * @conn: a #GstRTSPConnection
- * @message: the message to send
- * @timeout: a timeout value or #NULL
- *
- * Attempt to send @message to the connected @conn, blocking up to
- * the specified @timeout. @timeout can be #NULL, in which case this function
- * might block forever.
- *
- * This function can be cancelled with gst_rtsp_connection_flush().
- *
- * Returns: #GST_RTSP_OK on success.
- */
-GstRTSPResult
-gst_rtsp_connection_send (GstRTSPConnection * conn, GstRTSPMessage * message,
- GTimeVal * timeout)
+static GString *
+message_to_string (GstRTSPConnection * conn, GstRTSPMessage * message)
{
GString *str = NULL;
- GstRTSPResult res;
-
-#ifdef G_OS_WIN32
- WSADATA w;
- int error;
-#endif
-
- g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
- g_return_val_if_fail (message != NULL, GST_RTSP_EINVAL);
-
-#ifdef G_OS_WIN32
- error = WSAStartup (0x0202, &w);
-
- if (error)
- goto startup_error;
-
- if (w.wVersion != 0x0202)
- goto version_error;
-#endif
str = g_string_new ("");
@@ -530,14 +1288,19 @@
break;
}
default:
- g_return_val_if_reached (GST_RTSP_EINVAL);
+ g_string_free (str, TRUE);
+ g_return_val_if_reached (NULL);
break;
}
/* append headers and body */
if (message->type != GST_RTSP_MESSAGE_DATA) {
+ gchar date_string[100];
+
+ gen_date_string (date_string, sizeof (date_string));
+
/* add date header */
- add_date_header (message);
+ gst_rtsp_message_add_header (message, GST_RTSP_HDR_DATE, date_string);
/* append headers */
gst_rtsp_message_append_headers (message, str);
@@ -561,71 +1324,64 @@
}
}
+ return str;
+}
+
+/**
+ * gst_rtsp_connection_send:
+ * @conn: a #GstRTSPConnection
+ * @message: the message to send
+ * @timeout: a timeout value or #NULL
+ *
+ * Attempt to send @message to the connected @conn, blocking up to
+ * the specified @timeout. @timeout can be #NULL, in which case this function
+ * might block forever.
+ *
+ * This function can be cancelled with gst_rtsp_connection_flush().
+ *
+ * Returns: #GST_RTSP_OK on success.
+ */
+GstRTSPResult
+gst_rtsp_connection_send (GstRTSPConnection * conn, GstRTSPMessage * message,
+ GTimeVal * timeout)
+{
+ GString *string = NULL;
+ GstRTSPResult res;
+ gchar *str;
+ gsize len;
+
+ g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (message != NULL, GST_RTSP_EINVAL);
+
+ if (G_UNLIKELY (!(string = message_to_string (conn, message))))
+ goto no_message;
+
+ if (conn->tunneled) {
+ str = g_base64_encode ((const guchar *) string->str, string->len);
+ g_string_free (string, TRUE);
+ len = strlen (str);
+ } else {
+ str = string->str;
+ len = string->len;
+ g_string_free (string, FALSE);
+ }
+
/* write request */
- res =
- gst_rtsp_connection_write (conn, (guint8 *) str->str, str->len, timeout);
-
- g_string_free (str, TRUE);
+ res = gst_rtsp_connection_write (conn, (guint8 *) str, len, timeout);
+
+ g_free (str);
return res;
-#ifdef G_OS_WIN32
-startup_error:
- {
- g_warning ("Error %d on WSAStartup", error);
- return GST_RTSP_EWSASTART;
- }
-version_error:
+no_message:
{
- g_warning ("Windows sockets are not version 0x202 (current 0x%x)",
- w.wVersion);
- WSACleanup ();
- return GST_RTSP_EWSAVERSION;
- }
-#endif
-}
-
-static GstRTSPResult
-read_line (gint fd, gchar * buffer, guint size)
-{
- guint idx;
- gchar c;
- gint r;
-
- idx = 0;
- while (TRUE) {
- r = READ_SOCKET (fd, &c, 1);
- if (r == 0) {
- goto eof;
- } else if (r < 0) {
- if (ERRNO_IS_NOT_EAGAIN && ERRNO_IS_NOT_EINTR)
- goto read_error;
- } else {
- if (c == '\n') /* end on \n */
- break;
- if (c == '\r') /* ignore \r */
- continue;
-
- if (idx < size - 1)
- buffer[idx++] = c;
- }
- }
- buffer[idx] = '\0';
-
- return GST_RTSP_OK;
-
-eof:
- {
- return GST_RTSP_EEOF;
- }
-read_error:
- {
- return GST_RTSP_ESYS;
+ g_warning ("Wrong message");
+ return GST_RTSP_EINVAL;
}
}
static void
-read_string (gchar * dest, gint size, gchar ** src)
+parse_string (gchar * dest, gint size, gchar ** src)
{
gint idx;
@@ -644,7 +1400,7 @@
}
static void
-read_key (gchar * dest, gint size, gchar ** src)
+parse_key (gchar * dest, gint size, gchar ** src)
{
gint idx;
@@ -659,7 +1415,7 @@
}
static GstRTSPResult
-parse_response_status (gchar * buffer, GstRTSPMessage * msg)
+parse_response_status (guint8 * buffer, GstRTSPMessage * msg)
{
GstRTSPResult res;
gchar versionstr[20];
@@ -667,10 +1423,10 @@
gint code;
gchar *bptr;
- bptr = buffer;
-
- read_string (versionstr, sizeof (versionstr), &bptr);
- read_string (codestr, sizeof (codestr), &bptr);
+ bptr = (gchar *) buffer;
+
+ parse_string (versionstr, sizeof (versionstr), &bptr);
+ parse_string (codestr, sizeof (codestr), &bptr);
code = atoi (codestr);
while (g_ascii_isspace (*bptr))
@@ -695,7 +1451,8 @@
}
static GstRTSPResult
-parse_request_line (gchar * buffer, GstRTSPMessage * msg)
+parse_request_line (GstRTSPConnection * conn, guint8 * buffer,
+ GstRTSPMessage * msg)
{
GstRTSPResult res = GST_RTSP_OK;
gchar versionstr[20];
@@ -703,148 +1460,374 @@
gchar urlstr[4096];
gchar *bptr;
GstRTSPMethod method;
-
- bptr = buffer;
-
- read_string (methodstr, sizeof (methodstr), &bptr);
+ GstRTSPTunnelState tstate = TUNNEL_STATE_NONE;
+
+ bptr = (gchar *) buffer;
+
+ parse_string (methodstr, sizeof (methodstr), &bptr);
method = gst_rtsp_find_method (methodstr);
-
- read_string (urlstr, sizeof (urlstr), &bptr);
- if (*urlstr == '\0')
- res = GST_RTSP_EPARSE;
-
- read_string (versionstr, sizeof (versionstr), &bptr);
-
- if (*bptr != '\0')
- res = GST_RTSP_EPARSE;
+ if (method == GST_RTSP_INVALID) {
+ /* a tunnel request is allowed when we don't have one yet */
+ if (conn->tstate != TUNNEL_STATE_NONE)
+ goto invalid_method;
+ /* we need GET or POST for a valid tunnel request */
+ if (!strcmp (methodstr, "GET"))
+ tstate = TUNNEL_STATE_GET;
+ else if (!strcmp (methodstr, "POST"))
+ tstate = TUNNEL_STATE_POST;
+ else
+ goto invalid_method;
+ }
+
+ parse_string (urlstr, sizeof (urlstr), &bptr);
+ if (G_UNLIKELY (*urlstr == '\0'))
+ goto invalid_url;
+
+ parse_string (versionstr, sizeof (versionstr), &bptr);
+
+ if (G_UNLIKELY (*bptr != '\0'))
+ goto invalid_version;
if (strcmp (versionstr, "RTSP/1.0") == 0) {
- if (gst_rtsp_message_init_request (msg, method, urlstr) != GST_RTSP_OK)
- res = GST_RTSP_EPARSE;
+ res = gst_rtsp_message_init_request (msg, method, urlstr);
} else if (strncmp (versionstr, "RTSP/", 5) == 0) {
- if (gst_rtsp_message_init_request (msg, method, urlstr) != GST_RTSP_OK)
+ res = gst_rtsp_message_init_request (msg, method, urlstr);
+ msg->type_data.request.version = GST_RTSP_VERSION_INVALID;
+ } else if (strcmp (versionstr, "HTTP/1.0") == 0) {
+ /* tunnel request, we need a tunnel method */
+ if (tstate == TUNNEL_STATE_NONE) {
res = GST_RTSP_EPARSE;
- msg->type_data.request.version = GST_RTSP_VERSION_INVALID;
+ } else {
+ conn->tstate = tstate;
+ }
} else {
- gst_rtsp_message_init_request (msg, method, urlstr);
- msg->type_data.request.version = GST_RTSP_VERSION_INVALID;
res = GST_RTSP_EPARSE;
}
return res;
+
+ /* ERRORS */
+invalid_method:
+ {
+ GST_ERROR ("invalid method %s", methodstr);
+ return GST_RTSP_EPARSE;
+ }
+invalid_url:
+ {
+ GST_ERROR ("invalid url %s", urlstr);
+ return GST_RTSP_EPARSE;
+ }
+invalid_version:
+ {
+ GST_ERROR ("invalid version");
+ return GST_RTSP_EPARSE;
+ }
}
-/* parsing lines means reading a Key: Value pair */
static GstRTSPResult
-parse_line (gchar * buffer, GstRTSPMessage * msg)
+parse_key_value (guint8 * buffer, gchar * key, guint keysize, gchar ** value)
{
- gchar key[32];
gchar *bptr;
- GstRTSPHeaderField field;
-
- bptr = buffer;
+
+ bptr = (gchar *) buffer;
/* read key */
- read_key (key, sizeof (key), &bptr);
- if (*bptr != ':')
+ parse_key (key, keysize, &bptr);
+ if (G_UNLIKELY (*bptr != ':'))
goto no_column;
bptr++;
-
- field = gst_rtsp_find_header_field (key);
- if (field != GST_RTSP_HDR_INVALID) {
- while (g_ascii_isspace (*bptr))
- bptr++;
- gst_rtsp_message_add_header (msg, field, bptr);
- }
+ while (g_ascii_isspace (*bptr))
+ bptr++;
+
+ *value = bptr;
return GST_RTSP_OK;
+ /* ERRORS */
no_column:
{
return GST_RTSP_EPARSE;
}
}
+/* parsing lines means reading a Key: Value pair */
+static GstRTSPResult
+parse_line (GstRTSPConnection * conn, guint8 * buffer, GstRTSPMessage * msg)
+{
+ GstRTSPResult res;
+ gchar key[32];
+ gchar *value;
+ GstRTSPHeaderField field;
+
+ res = parse_key_value (buffer, key, sizeof (key), &value);
+ if (G_UNLIKELY (res != GST_RTSP_OK))
+ goto parse_error;
+
+ if (conn->tstate == TUNNEL_STATE_GET || conn->tstate == TUNNEL_STATE_POST) {
+ /* save the tunnel session in the connection */
+ if (!strcmp (key, "x-sessioncookie")) {
+ strncpy (conn->tunnelid, value, TUNNELID_LEN);
+ conn->tunnelid[TUNNELID_LEN - 1] = '\0';
+ conn->tunneled = TRUE;
+ }
+ } else {
+ field = gst_rtsp_find_header_field (key);
+ if (field != GST_RTSP_HDR_INVALID)
+ gst_rtsp_message_add_header (msg, field, value);
+ }
+
+ return GST_RTSP_OK;
+
+ /* ERRORS */
+parse_error:
+ {
+ return res;
+ }
+}
+
+/* returns:
+ * GST_RTSP_OK when a complete message was read.
+ * GST_RTSP_EEOF: when the socket is closed
+ * GST_RTSP_EINTR: when more data is needed.
+ * GST_RTSP_..: some other error occured.
+ */
+static GstRTSPResult
+build_next (GstRTSPBuilder * builder, GstRTSPMessage * message,
+ GstRTSPConnection * conn)
+{
+ GstRTSPResult res;
+
+ while (TRUE) {
+ switch (builder->state) {
+ case STATE_START:
+ builder->offset = 0;
+ res =
+ read_bytes (conn->readfd->fd, (guint8 *) builder->buffer,
+ &builder->offset, 1, conn->ctxp);
+ if (res != GST_RTSP_OK)
+ goto done;
+
+ /* we have 1 bytes now and we can see if this is a data message or
+ * not */
+ if (builder->buffer[0] == '$') {
+ /* data message, prepare for the header */
+ builder->state = STATE_DATA_HEADER;
+ } else {
+ builder->line = 0;
+ builder->state = STATE_READ_LINES;
+ }
+ break;
+ case STATE_DATA_HEADER:
+ {
+ res =
+ read_bytes (conn->readfd->fd, (guint8 *) builder->buffer,
+ &builder->offset, 4, conn->ctxp);
+ if (res != GST_RTSP_OK)
+ goto done;
+
+ gst_rtsp_message_init_data (message, builder->buffer[1]);
+
+ builder->body_len = (builder->buffer[2] << 8) | builder->buffer[3];
+ builder->body_data = g_malloc (builder->body_len + 1);
+ builder->body_data[builder->body_len] = '\0';
+ builder->offset = 0;
+ builder->state = STATE_DATA_BODY;
+ break;
+ }
+ case STATE_DATA_BODY:
+ {
+ res =
+ read_bytes (conn->readfd->fd, builder->body_data, &builder->offset,
+ builder->body_len, conn->ctxp);
+ if (res != GST_RTSP_OK)
+ goto done;
+
+ /* we have the complete body now, store in the message adjusting the
+ * length to include the traling '\0' */
+ gst_rtsp_message_take_body (message,
+ (guint8 *) builder->body_data, builder->body_len + 1);
+ builder->body_data = NULL;
+ builder->body_len = 0;
+
+ builder->state = STATE_END;
+ break;
+ }
+ case STATE_READ_LINES:
+ {
+ res = read_line (conn->readfd->fd, builder->buffer, &builder->offset,
+ sizeof (builder->buffer), conn->ctxp);
+ if (res != GST_RTSP_OK)
+ goto done;
+
+ /* we have a regular response */
+ if (builder->buffer[0] == '\r') {
+ builder->buffer[0] = '\0';
+ }
+
+ if (builder->buffer[0] == '\0') {
+ gchar *hdrval;
+
+ /* empty line, end of message header */
+ /* see if there is a Content-Length header */
+ if (gst_rtsp_message_get_header (message,
+ GST_RTSP_HDR_CONTENT_LENGTH, &hdrval, 0) == GST_RTSP_OK) {
+ /* there is, prepare to read the body */
+ builder->body_len = atol (hdrval);
+ builder->body_data = g_malloc (builder->body_len + 1);
+ builder->body_data[builder->body_len] = '\0';
+ builder->offset = 0;
+ builder->state = STATE_DATA_BODY;
+ } else {
+ builder->state = STATE_END;
+ }
+ break;
+ }
+
+ /* we have a line */
+ if (builder->line == 0) {
+ /* first line, check for response status */
+ if (memcmp (builder->buffer, "RTSP", 4) == 0) {
+ res = parse_response_status (builder->buffer, message);
+ } else {
+ res = parse_request_line (conn, builder->buffer, message);
+ }
+ /* the first line must parse without errors */
+ if (res != GST_RTSP_OK)
+ goto done;
+ } else {
+ /* else just parse the line, ignore errors */
+ parse_line (conn, builder->buffer, message);
+ }
+ builder->line++;
+ builder->offset = 0;
+ break;
+ }
+ case STATE_END:
+ {
+ gchar *session_id;
+
+ if (conn->tstate == TUNNEL_STATE_GET) {
+ res = GST_RTSP_ETGET;
+ goto done;
+ } else if (conn->tstate == TUNNEL_STATE_POST) {
+ res = GST_RTSP_ETPOST;
+ goto done;
+ }
+
+ if (message->type == GST_RTSP_MESSAGE_DATA) {
+ /* data messages don't have headers */
+ res = GST_RTSP_OK;
+ goto done;
+ }
+
+ /* save session id in the connection for further use */
+ if (message->type == GST_RTSP_MESSAGE_RESPONSE &&
+ gst_rtsp_message_get_header (message, GST_RTSP_HDR_SESSION,
+ &session_id, 0) == GST_RTSP_OK) {
+ gint maxlen, i;
+
+ maxlen = sizeof (conn->session_id) - 1;
+ /* the sessionid can have attributes marked with ;
+ * Make sure we strip them */
+ for (i = 0; session_id[i] != '\0'; i++) {
+ if (session_id[i] == ';') {
+ maxlen = i;
+ /* parse timeout */
+ do {
+ i++;
+ } while (g_ascii_isspace (session_id[i]));
+ if (g_str_has_prefix (&session_id[i], "timeout=")) {
+ gint to;
+
+ /* if we parsed something valid, configure */
+ if ((to = atoi (&session_id[i + 8])) > 0)
+ conn->timeout = to;
+ }
+ break;
+ }
+ }
+
+ /* make sure to not overflow */
+ strncpy (conn->session_id, session_id, maxlen);
+ conn->session_id[maxlen] = '\0';
+ }
+ res = GST_RTSP_OK;
+ goto done;
+ }
+ default:
+ res = GST_RTSP_ERROR;
+ break;
+ }
+ }
+done:
+ return res;
+}
+
/**
- * gst_rtsp_connection_read_internal:
+ * gst_rtsp_connection_read:
* @conn: a #GstRTSPConnection
* @data: the data to read
* @size: the size of @data
* @timeout: a timeout value or #NULL
- * @allow_interrupt: can the pending read be interrupted
*
* Attempt to read @size bytes into @data from the connected @conn, blocking up to
* the specified @timeout. @timeout can be #NULL, in which case this function
* might block forever.
- *
- * This function can be cancelled with gst_rtsp_connection_flush() only if
- * @allow_interrupt is set.
+ *
+ * This function can be cancelled with gst_rtsp_connection_flush().
*
* Returns: #GST_RTSP_OK on success.
*/
-static GstRTSPResult
-gst_rtsp_connection_read_internal (GstRTSPConnection * conn, guint8 * data,
- guint size, GTimeVal * timeout, gboolean allow_interrupt)
+GstRTSPResult
+gst_rtsp_connection_read (GstRTSPConnection * conn, guint8 * data, guint size,
+ GTimeVal * timeout)
{
- guint toread;
+ guint offset;
gint retval;
GstClockTime to;
- FIONREAD_TYPE avail;
+ GstRTSPResult res;
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (data != NULL, GST_RTSP_EINVAL);
-
- if (size == 0)
+ g_return_val_if_fail (conn->readfd != NULL, GST_RTSP_EINVAL);
+
+ if (G_UNLIKELY (size == 0))
return GST_RTSP_OK;
- toread = size;
+ offset = 0;
/* configure timeout if any */
to = timeout ? GST_TIMEVAL_TO_TIME (*timeout) : GST_CLOCK_TIME_NONE;
- /* if the call fails, just go in the select.. it should not fail. Else if
- * there is enough data to read, skip the select call al together.*/
- if (IOCTL_SOCKET (conn->fd.fd, FIONREAD, &avail) < 0)
- avail = 0;
- else if (avail >= toread)
- goto do_read;
-
- gst_poll_set_controllable (conn->fdset, allow_interrupt);
- gst_poll_fd_ctl_write (conn->fdset, &conn->fd, FALSE);
- gst_poll_fd_ctl_read (conn->fdset, &conn->fd, TRUE);
-
- while (toread > 0) {
- gint bytes;
+ gst_poll_set_controllable (conn->fdset, TRUE);
+ gst_poll_fd_ctl_write (conn->fdset, conn->writefd, FALSE);
+ gst_poll_fd_ctl_read (conn->fdset, conn->readfd, TRUE);
+
+ while (TRUE) {
+ res = read_bytes (conn->readfd->fd, data, &offset, size, conn->ctxp);
+ if (G_UNLIKELY (res == GST_RTSP_EEOF))
+ goto eof;
+ if (G_LIKELY (res == GST_RTSP_OK))
+ break;
+ if (G_UNLIKELY (res != GST_RTSP_EINTR))
+ goto read_error;
do {
retval = gst_poll_wait (conn->fdset, to);
} while (retval == -1 && (errno == EINTR || errno == EAGAIN));
- if (retval == -1) {
+ /* check for timeout */
+ if (G_UNLIKELY (retval == 0))
+ goto select_timeout;
+
+ if (G_UNLIKELY (retval == -1)) {
if (errno == EBUSY)
goto stopped;
else
goto select_error;
}
-
- /* check for timeout */
- if (retval == 0)
- goto select_timeout;
-
- do_read:
- /* if we get here there is activity on the real fd since the select
- * completed and the control socket was not readable. */
- bytes = READ_SOCKET (conn->fd.fd, data, toread);
- if (bytes == 0) {
- goto eof;
- } else if (bytes < 0) {
- if (ERRNO_IS_NOT_EAGAIN && ERRNO_IS_NOT_EINTR)
- goto read_error;
- } else {
- toread -= bytes;
- data += bytes;
- }
+ gst_poll_set_controllable (conn->fdset, FALSE);
}
return GST_RTSP_OK;
@@ -867,65 +1850,42 @@
}
read_error:
{
- return GST_RTSP_ESYS;
+ return res;
}
}
-/**
- * gst_rtsp_connection_read:
- * @conn: a #GstRTSPConnection
- * @data: the data to read
- * @size: the size of @data
- * @timeout: a timeout value or #NULL
- *
- * Attempt to read @size bytes into @data from the connected @conn, blocking up to
- * the specified @timeout. @timeout can be #NULL, in which case this function
- * might block forever.
- *
- * This function can be cancelled with gst_rtsp_connection_flush().
- *
- * Returns: #GST_RTSP_OK on success.
- */
-GstRTSPResult
-gst_rtsp_connection_read (GstRTSPConnection * conn, guint8 * data, guint size,
- GTimeVal * timeout)
-{
- return gst_rtsp_connection_read_internal (conn, data, size, timeout, TRUE);
-}
-
-
-static GstRTSPResult
-read_body (GstRTSPConnection * conn, glong content_length, GstRTSPMessage * msg,
- GTimeVal * timeout)
+static GString *
+gen_tunnel_reply (GstRTSPConnection * conn, GstRTSPStatusCode code)
{
- guint8 *body;
- GstRTSPResult res;
-
- if (content_length <= 0) {
- body = NULL;
- content_length = 0;
- goto done;
+ GString *str;
+ gchar date_string[100];
+ const gchar *status;
+
+ gen_date_string (date_string, sizeof (date_string));
+
+ status = gst_rtsp_status_as_text (code);
+ if (status == NULL) {
+ code = GST_RTSP_STS_INTERNAL_SERVER_ERROR;
+ status = "Internal Server Error";
}
- body = g_malloc (content_length + 1);
- body[content_length] = '\0';
-
- GST_RTSP_CHECK (gst_rtsp_connection_read_internal (conn, body, content_length,
- timeout, FALSE), read_error);
-
- content_length += 1;
-
-done:
- gst_rtsp_message_take_body (msg, (guint8 *) body, content_length);
-
- return GST_RTSP_OK;
-
- /* ERRORS */
-read_error:
- {
- g_free (body);
- return res;
+ str = g_string_new ("");
+
+ /* */
+ g_string_append_printf (str, "HTTP/1.0 %d %s\r\n", code, status);
+ g_string_append_printf (str,
+ "Server: GStreamer RTSP Server\r\n"
+ "Date: %s\r\n"
+ "Connection: close\r\n"
+ "Cache-Control: no-store\r\n" "Pragma: no-cache\r\n", date_string);
+ if (code == GST_RTSP_STS_OK) {
+ if (conn->ip)
+ g_string_append_printf (str, "x-server-ip-address: %s\r\n", conn->ip);
+ g_string_append_printf (str,
+ "Content-Type: application/x-rtsp-tunnelled\r\n");
}
+ g_string_append_printf (str, "\r\n");
+ return str;
}
/**
@@ -946,138 +1906,93 @@
gst_rtsp_connection_receive (GstRTSPConnection * conn, GstRTSPMessage * message,
GTimeVal * timeout)
{
- gchar buffer[4096];
- gint line;
- glong content_length;
GstRTSPResult res;
- gboolean need_body;
+ GstRTSPBuilder builder;
+ gint retval;
+ GstClockTime to;
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (message != NULL, GST_RTSP_EINVAL);
-
- line = 0;
-
- need_body = TRUE;
-
- res = GST_RTSP_OK;
- /* parse first line and headers */
- while (res == GST_RTSP_OK) {
- guint8 c;
-
- /* read first character, this identifies data messages */
- /* This is the only read() that we allow to be interrupted */
- GST_RTSP_CHECK (gst_rtsp_connection_read_internal (conn, &c, 1, timeout,
- TRUE), read_error);
-
- /* check for data packet, first character is $ */
- if (c == '$') {
- guint16 size;
-
- /* data packets are $<1 byte channel><2 bytes length,BE> */
-
- /* read channel, which is the next char */
- GST_RTSP_CHECK (gst_rtsp_connection_read_internal (conn, &c, 1, timeout,
- FALSE), read_error);
-
- /* now we create a data message */
- gst_rtsp_message_init_data (message, c);
-
- /* next two bytes are the length of the data */
- GST_RTSP_CHECK (gst_rtsp_connection_read_internal (conn,
- (guint8 *) & size, 2, timeout, FALSE), read_error);
-
- size = GUINT16_FROM_BE (size);
-
- /* and read the body */
- res = read_body (conn, size, message, timeout);
- need_body = FALSE;
+ g_return_val_if_fail (conn->readfd != NULL, GST_RTSP_EINVAL);
+
+ /* configure timeout if any */
+ to = timeout ? GST_TIMEVAL_TO_TIME (*timeout) : GST_CLOCK_TIME_NONE;
+
+ gst_poll_set_controllable (conn->fdset, TRUE);
+ gst_poll_fd_ctl_write (conn->fdset, conn->writefd, FALSE);
+ gst_poll_fd_ctl_read (conn->fdset, conn->readfd, TRUE);
+
+ memset (&builder, 0, sizeof (GstRTSPBuilder));
+ while (TRUE) {
+ res = build_next (&builder, message, conn);
+ if (G_UNLIKELY (res == GST_RTSP_EEOF))
+ goto eof;
+ if (G_LIKELY (res == GST_RTSP_OK))
+ break;
+ if (res == GST_RTSP_ETGET) {
+ GString *str;
+
+ /* tunnel GET request, we can reply now */
+ str = gen_tunnel_reply (conn, GST_RTSP_STS_OK);
+ res =
+ gst_rtsp_connection_write (conn, (guint8 *) str->str, str->len,
+ timeout);
+ g_string_free (str, TRUE);
+ } else if (res == GST_RTSP_ETPOST) {
+ /* tunnel POST request, return the value, the caller now has to link the
+ * two connections. */
break;
- } else {
- gint offset = 0;
-
- /* we have a regular response */
- if (c != '\r') {
- buffer[0] = c;
- offset = 1;
- }
- /* should not happen */
- if (c == '\n')
- break;
-
- /* read lines */
- GST_RTSP_CHECK (read_line (conn->fd.fd, buffer + offset,
- sizeof (buffer) - offset), read_error);
-
- if (buffer[0] == '\0')
- break;
-
- if (line == 0) {
- /* first line, check for response status */
- if (g_str_has_prefix (buffer, "RTSP")) {
- res = parse_response_status (buffer, message);
- } else {
- res = parse_request_line (buffer, message);
- }
- } else {
- /* else just parse the line */
- parse_line (buffer, message);
- }
+ } else if (G_UNLIKELY (res != GST_RTSP_EINTR))
+ goto read_error;
+
+ do {
+ retval = gst_poll_wait (conn->fdset, to);
+ } while (retval == -1 && (errno == EINTR || errno == EAGAIN));
+
+ /* check for timeout */
+ if (G_UNLIKELY (retval == 0))
+ goto select_timeout;
+
+ if (G_UNLIKELY (retval == -1)) {
+ if (errno == EBUSY)
+ goto stopped;
+ else
+ goto select_error;
}
- line++;
+ gst_poll_set_controllable (conn->fdset, FALSE);
}
- /* read the rest of the body if needed */
- if (need_body) {
- gchar *session_id;
- gchar *hdrval;
-
- /* see if there is a Content-Length header */
- if (gst_rtsp_message_get_header (message, GST_RTSP_HDR_CONTENT_LENGTH,
- &hdrval, 0) == GST_RTSP_OK) {
- /* there is, read the body */
- content_length = atol (hdrval);
- GST_RTSP_CHECK (read_body (conn, content_length, message, timeout),
- read_error);
- }
-
- /* save session id in the connection for further use */
- if (gst_rtsp_message_get_header (message, GST_RTSP_HDR_SESSION,
- &session_id, 0) == GST_RTSP_OK) {
- gint maxlen, i;
-
- /* default session timeout */
- conn->timeout = 60;
-
- maxlen = sizeof (conn->session_id) - 1;
- /* the sessionid can have attributes marked with ;
- * Make sure we strip them */
- for (i = 0; session_id[i] != '\0'; i++) {
- if (session_id[i] == ';') {
- maxlen = i;
- /* parse timeout */
- do {
- i++;
- } while (g_ascii_isspace (session_id[i]));
- if (g_str_has_prefix (&session_id[i], "timeout=")) {
- gint to;
-
- /* if we parsed something valid, configure */
- if ((to = atoi (&session_id[i + 9])) > 0)
- conn->timeout = to;
- }
- break;
- }
- }
-
- /* make sure to not overflow */
- strncpy (conn->session_id, session_id, maxlen);
- conn->session_id[maxlen] = '\0';
- }
+ /* we have a message here */
+ build_reset (&builder);
+
+ return GST_RTSP_OK;
+
+ /* ERRORS */
+select_error:
+ {
+ res = GST_RTSP_ESYS;
+ goto cleanup;
+ }
+select_timeout:
+ {
+ res = GST_RTSP_ETIMEOUT;
+ goto cleanup;
}
- return res;
-
+stopped:
+ {
+ res = GST_RTSP_EINTR;
+ goto cleanup;
+ }
+eof:
+ {
+ res = GST_RTSP_EEOF;
+ goto cleanup;
+ }
read_error:
+cleanup:
{
+ build_reset (&builder);
+ gst_rtsp_message_unset (message);
return res;
}
}
@@ -1086,37 +2001,36 @@
* gst_rtsp_connection_close:
* @conn: a #GstRTSPConnection
*
- * Close the connected @conn.
+ * Close the connected @conn. After this call, the connection is in the same
+ * state as when it was first created.
*
* Returns: #GST_RTSP_OK on success.
*/
GstRTSPResult
gst_rtsp_connection_close (GstRTSPConnection * conn)
{
- gint res;
-
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
g_free (conn->ip);
conn->ip = NULL;
- if (conn->fd.fd != -1) {
- gst_poll_remove_fd (conn->fdset, &conn->fd);
- res = CLOSE_SOCKET (conn->fd.fd);
- conn->fd.fd = -1;
-#ifdef G_OS_WIN32
- WSACleanup ();
-#endif
- if (res != 0)
- goto sys_error;
- }
+ REMOVE_POLLFD (conn->fdset, &conn->fd0);
+ REMOVE_POLLFD (conn->fdset, &conn->fd1);
+ conn->writefd = NULL;
+ conn->readfd = NULL;
+ conn->tunneled = FALSE;
+ conn->tstate = TUNNEL_STATE_NONE;
+ conn->ctxp = NULL;
+ g_free (conn->username);
+ conn->username = NULL;
+ g_free (conn->passwd);
+ conn->passwd = NULL;
+ gst_rtsp_connection_clear_auth_params (conn);
+ conn->timeout = 60;
+ conn->cseq = 0;
+ conn->session_id[0] = '\0';
return GST_RTSP_OK;
-
-sys_error:
- {
- return GST_RTSP_ESYS;
- }
}
/**
@@ -1136,13 +2050,13 @@
res = gst_rtsp_connection_close (conn);
gst_poll_free (conn->fdset);
+ g_timer_destroy (conn->timer);
+ gst_rtsp_url_free (conn->url);
+ g_free (conn->proxy_host);
+ g_free (conn);
#ifdef G_OS_WIN32
WSACleanup ();
#endif
- g_timer_destroy (conn->timer);
- g_free (conn->username);
- g_free (conn->passwd);
- g_free (conn);
return res;
}
@@ -1177,14 +2091,17 @@
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (events != 0, GST_RTSP_EINVAL);
g_return_val_if_fail (revents != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (conn->readfd != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (conn->writefd != NULL, GST_RTSP_EINVAL);
gst_poll_set_controllable (conn->fdset, TRUE);
/* add fd to writer set when asked to */
- gst_poll_fd_ctl_write (conn->fdset, &conn->fd, events & GST_RTSP_EV_WRITE);
+ gst_poll_fd_ctl_write (conn->fdset, conn->writefd,
+ events & GST_RTSP_EV_WRITE);
/* add fd to reader set when asked to */
- gst_poll_fd_ctl_read (conn->fdset, &conn->fd, events & GST_RTSP_EV_READ);
+ gst_poll_fd_ctl_read (conn->fdset, conn->readfd, events & GST_RTSP_EV_READ);
/* configure timeout if any */
to = timeout ? GST_TIMEVAL_TO_TIME (*timeout) : GST_CLOCK_TIME_NONE;
@@ -1193,10 +2110,10 @@
retval = gst_poll_wait (conn->fdset, to);
} while (retval == -1 && (errno == EINTR || errno == EAGAIN));
- if (retval == 0)
+ if (G_UNLIKELY (retval == 0))
goto select_timeout;
- if (retval == -1) {
+ if (G_UNLIKELY (retval == -1)) {
if (errno == EBUSY)
goto stopped;
else
@@ -1205,11 +2122,11 @@
*revents = 0;
if (events & GST_RTSP_EV_READ) {
- if (gst_poll_fd_can_read (conn->fdset, &conn->fd))
+ if (gst_poll_fd_can_read (conn->fdset, conn->readfd))
*revents |= GST_RTSP_EV_READ;
}
if (events & GST_RTSP_EV_WRITE) {
- if (gst_poll_fd_can_write (conn->fdset, &conn->fd))
+ if (gst_poll_fd_can_write (conn->fdset, conn->writefd))
*revents |= GST_RTSP_EV_WRITE;
}
return GST_RTSP_OK;
@@ -1302,6 +2219,31 @@
}
/**
+ * gst_rtsp_connection_set_proxy:
+ * @conn: a #GstRTSPConnection
+ * @host: the proxy host
+ * @port: the proxy port
+ *
+ * Set the proxy host and port.
+ *
+ * Returns: #GST_RTSP_OK.
+ *
+ * Since: 0.10.23
+ */
+GstRTSPResult
+gst_rtsp_connection_set_proxy (GstRTSPConnection * conn,
+ const gchar * host, guint port)
+{
+ g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
+
+ g_free (conn->proxy_host);
+ conn->proxy_host = g_strdup (host);
+ conn->proxy_port = port;
+
+ return GST_RTSP_OK;
+}
+
+/**
* gst_rtsp_connection_set_auth:
* @conn: a #GstRTSPConnection
* @method: authentication method
@@ -1317,9 +2259,11 @@
gst_rtsp_connection_set_auth (GstRTSPConnection * conn,
GstRTSPAuthMethod method, const gchar * user, const gchar * pass)
{
- /* Digest isn't implemented yet */
- if (method == GST_RTSP_AUTH_DIGEST)
- return GST_RTSP_ENOTIMPL;
+ g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
+
+ if (method == GST_RTSP_AUTH_DIGEST && ((user == NULL || pass == NULL)
+ || g_strrstr (user, ":") != NULL))
+ return GST_RTSP_EINVAL;
/* Make sure the username and passwd are being set for authentication */
if (method == GST_RTSP_AUTH_NONE && (user == NULL || pass == NULL))
@@ -1338,3 +2282,786 @@
return GST_RTSP_OK;
}
+
+/**
+ * str_case_hash:
+ * @key: ASCII string to hash
+ *
+ * Hashes @key in a case-insensitive manner.
+ *
+ * Returns: the hash code.
+ **/
+static guint
+str_case_hash (gconstpointer key)
+{
+ const char *p = key;
+ guint h = g_ascii_toupper (*p);
+
+ if (h)
+ for (p += 1; *p != '\0'; p++)
+ h = (h << 5) - h + g_ascii_toupper (*p);
+
+ return h;
+}
+
+/**
+ * str_case_equal:
+ * @v1: an ASCII string
+ * @v2: another ASCII string
+ *
+ * Compares @v1 and @v2 in a case-insensitive manner
+ *
+ * Returns: %TRUE if they are equal (modulo case)
+ **/
+static gboolean
+str_case_equal (gconstpointer v1, gconstpointer v2)
+{
+ const char *string1 = v1;
+ const char *string2 = v2;
+
+ return g_ascii_strcasecmp (string1, string2) == 0;
+}
+
+/**
+ * gst_rtsp_connection_set_auth_param:
+ * @conn: a #GstRTSPConnection
+ * @param: authentication directive
+ * @value: value
+ *
+ * Setup @conn with authentication directives. This is not necesary for
+ * methods #GST_RTSP_AUTH_NONE and #GST_RTSP_AUTH_BASIC. For
+ * #GST_RTSP_AUTH_DIGEST, directives should be taken from the digest challenge
+ * in the WWW-Authenticate response header and can include realm, domain,
+ * nonce, opaque, stale, algorithm, qop as per RFC2617.
+ *
+ * Since: 0.10.20
+ */
+void
+gst_rtsp_connection_set_auth_param (GstRTSPConnection * conn,
+ const gchar * param, const gchar * value)
+{
+ g_return_if_fail (conn != NULL);
+ g_return_if_fail (param != NULL);
+
+ if (conn->auth_params == NULL) {
+ conn->auth_params =
+ g_hash_table_new_full (str_case_hash, str_case_equal, g_free, g_free);
+ }
+ g_hash_table_insert (conn->auth_params, g_strdup (param), g_strdup (value));
+}
+
+/**
+ * gst_rtsp_connection_clear_auth_params:
+ * @conn: a #GstRTSPConnection
+ *
+ * Clear the list of authentication directives stored in @conn.
+ *
+ * Since: 0.10.20
+ */
+void
+gst_rtsp_connection_clear_auth_params (GstRTSPConnection * conn)
+{
+ g_return_if_fail (conn != NULL);
+
+ if (conn->auth_params != NULL) {
+ g_hash_table_destroy (conn->auth_params);
+ conn->auth_params = NULL;
+ }
+}
+
+static GstRTSPResult
+set_qos_dscp (gint fd, guint qos_dscp)
+{
+ union gst_sockaddr sa;
+ socklen_t slen = sizeof (sa);
+ gint af;
+ gint tos;
+
+ if (fd == -1)
+ return GST_RTSP_OK;
+
+ if (getsockname (fd, &sa.sa, &slen) < 0)
+ goto no_getsockname;
+
+ af = sa.sa.sa_family;
+
+ /* if this is an IPv4-mapped address then do IPv4 QoS */
+ if (af == AF_INET6) {
+ if (IN6_IS_ADDR_V4MAPPED (&sa.sa_in6.sin6_addr))
+ af = AF_INET;
+ }
+
+ /* extract and shift 6 bits of the DSCP */
+ tos = (qos_dscp & 0x3f) << 2;
+
+ switch (af) {
+ case AF_INET:
+ if (SETSOCKOPT (fd, IPPROTO_IP, IP_TOS, &tos, sizeof (tos)) < 0)
+ goto no_setsockopt;
+ break;
+ case AF_INET6:
+#ifdef IPV6_TCLASS
+ if (SETSOCKOPT (fd, IPPROTO_IPV6, IPV6_TCLASS, &tos, sizeof (tos)) < 0)
+ goto no_setsockopt;
+ break;
+#endif
+ default:
+ goto wrong_family;
+ }
+
+ return GST_RTSP_OK;
+
+ /* ERRORS */
+no_getsockname:
+no_setsockopt:
+ {
+ return GST_RTSP_ESYS;
+ }
+
+wrong_family:
+ {
+ return GST_RTSP_ERROR;
+ }
+}
+
+/**
+ * gst_rtsp_connection_set_qos_dscp:
+ * @conn: a #GstRTSPConnection
+ * @qos_dscp: DSCP value
+ *
+ * Configure @conn to use the specified DSCP value.
+ *
+ * Returns: #GST_RTSP_OK on success.
+ *
+ * Since: 0.10.20
+ */
+GstRTSPResult
+gst_rtsp_connection_set_qos_dscp (GstRTSPConnection * conn, guint qos_dscp)
+{
+ GstRTSPResult res;
+
+ g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (conn->readfd != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (conn->writefd != NULL, GST_RTSP_EINVAL);
+
+ res = set_qos_dscp (conn->fd0.fd, qos_dscp);
+ if (res == GST_RTSP_OK)
+ res = set_qos_dscp (conn->fd1.fd, qos_dscp);
+
+ return res;
+}
+
+
+/**
+ * gst_rtsp_connection_get_url:
+ * @conn: a #GstRTSPConnection
+ *
+ * Retrieve the URL of the other end of @conn.
+ *
+ * Returns: The URL. This value remains valid until the
+ * connection is freed.
+ *
+ * Since: 0.10.23
+ */
+GstRTSPUrl *
+gst_rtsp_connection_get_url (const GstRTSPConnection * conn)
+{
+ g_return_val_if_fail (conn != NULL, NULL);
+
+ return conn->url;
+}
+
+/**
+ * gst_rtsp_connection_get_ip:
+ * @conn: a #GstRTSPConnection
+ *
+ * Retrieve the IP address of the other end of @conn.
+ *
+ * Returns: The IP address as a string. this value remains valid until the
+ * connection is closed.
+ *
+ * Since: 0.10.20
+ */
+const gchar *
+gst_rtsp_connection_get_ip (const GstRTSPConnection * conn)
+{
+ g_return_val_if_fail (conn != NULL, NULL);
+
+ return conn->ip;
+}
+
+/**
+ * gst_rtsp_connection_set_ip:
+ * @conn: a #GstRTSPConnection
+ * @ip: an ip address
+ *
+ * Set the IP address of the server.
+ *
+ * Since: 0.10.23
+ */
+void
+gst_rtsp_connection_set_ip (GstRTSPConnection * conn, const gchar * ip)
+{
+ g_return_if_fail (conn != NULL);
+
+ g_free (conn->ip);
+ conn->ip = g_strdup (ip);
+}
+
+/**
+ * gst_rtsp_connection_get_readfd:
+ * @conn: a #GstRTSPConnection
+ *
+ * Get the file descriptor for reading.
+ *
+ * Returns: the file descriptor used for reading or -1 on error. The file
+ * descriptor remains valid until the connection is closed.
+ *
+ * Since: 0.10.23
+ */
+gint
+gst_rtsp_connection_get_readfd (const GstRTSPConnection * conn)
+{
+ g_return_val_if_fail (conn != NULL, -1);
+ g_return_val_if_fail (conn->readfd != NULL, -1);
+
+ return conn->readfd->fd;
+}
+
+/**
+ * gst_rtsp_connection_get_writefd:
+ * @conn: a #GstRTSPConnection
+ *
+ * Get the file descriptor for writing.
+ *
+ * Returns: the file descriptor used for writing or -1 on error. The file
+ * descriptor remains valid until the connection is closed.
+ *
+ * Since: 0.10.23
+ */
+gint
+gst_rtsp_connection_get_writefd (const GstRTSPConnection * conn)
+{
+ g_return_val_if_fail (conn != NULL, -1);
+ g_return_val_if_fail (conn->writefd != NULL, -1);
+
+ return conn->writefd->fd;
+}
+
+
+/**
+ * gst_rtsp_connection_set_tunneled:
+ * @conn: a #GstRTSPConnection
+ * @tunneled: the new state
+ *
+ * Set the HTTP tunneling state of the connection. This must be configured before
+ * the @conn is connected.
+ *
+ * Since: 0.10.23
+ */
+void
+gst_rtsp_connection_set_tunneled (GstRTSPConnection * conn, gboolean tunneled)
+{
+ g_return_if_fail (conn != NULL);
+ g_return_if_fail (conn->readfd == NULL);
+ g_return_if_fail (conn->writefd == NULL);
+
+ conn->tunneled = tunneled;
+}
+
+/**
+ * gst_rtsp_connection_is_tunneled:
+ * @conn: a #GstRTSPConnection
+ *
+ * Get the tunneling state of the connection.
+ *
+ * Returns: if @conn is using HTTP tunneling.
+ *
+ * Since: 0.10.23
+ */
+gboolean
+gst_rtsp_connection_is_tunneled (const GstRTSPConnection * conn)
+{
+ g_return_val_if_fail (conn != NULL, FALSE);
+
+ return conn->tunneled;
+}
+
+/**
+ * gst_rtsp_connection_get_tunnelid:
+ * @conn: a #GstRTSPConnection
+ *
+ * Get the tunnel session id the connection.
+ *
+ * Returns: returns a non-empty string if @conn is being tunneled over HTTP.
+ *
+ * Since: 0.10.23
+ */
+const gchar *
+gst_rtsp_connection_get_tunnelid (const GstRTSPConnection * conn)
+{
+ g_return_val_if_fail (conn != NULL, NULL);
+
+ if (!conn->tunneled)
+ return NULL;
+
+ return conn->tunnelid;
+}
+
+/**
+ * gst_rtsp_connection_do_tunnel:
+ * @conn: a #GstRTSPConnection
+ * @conn2: a #GstRTSPConnection
+ *
+ * If @conn received the first tunnel connection and @conn2 received
+ * the second tunnel connection, link the two connections together so that
+ * @conn manages the tunneled connection.
+ *
+ * After this call, @conn2 cannot be used anymore and must be freed with
+ * gst_rtsp_connection_free().
+ *
+ * Returns: return GST_RTSP_OK on success.
+ *
+ * Since: 0.10.23
+ */
+GstRTSPResult
+gst_rtsp_connection_do_tunnel (GstRTSPConnection * conn,
+ GstRTSPConnection * conn2)
+{
+ g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (conn2 != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (conn->tstate == TUNNEL_STATE_GET, GST_RTSP_EINVAL);
+ g_return_val_if_fail (conn2->tstate == TUNNEL_STATE_POST, GST_RTSP_EINVAL);
+ g_return_val_if_fail (!memcmp (conn2->tunnelid, conn->tunnelid, TUNNELID_LEN),
+ GST_RTSP_EINVAL);
+
+ /* both connections have fd0 as the read/write socket. start by taking the
+ * socket from conn2 and set it as the socket in conn */
+ conn->fd1 = conn2->fd0;
+
+ /* clean up some of the state of conn2 */
+ gst_poll_remove_fd (conn2->fdset, &conn2->fd0);
+ conn2->fd0.fd = -1;
+ conn2->readfd = conn2->writefd = NULL;
+
+ /* We make fd0 the write socket and fd1 the read socket. */
+ conn->writefd = &conn->fd0;
+ conn->readfd = &conn->fd1;
+
+ conn->tstate = TUNNEL_STATE_COMPLETE;
+
+ /* we need base64 decoding for the readfd */
+ conn->ctx.state = 0;
+ conn->ctx.save = 0;
+ conn->ctx.cout = 0;
+ conn->ctx.coutl = 0;
+ conn->ctxp = &conn->ctx;
+
+ return GST_RTSP_OK;
+}
+
+#define READ_COND (G_IO_IN | G_IO_HUP | G_IO_ERR)
+#define WRITE_COND (G_IO_OUT | G_IO_ERR)
+
+typedef struct
+{
+ guint8 *data;
+ guint size;
+ guint id;
+} GstRTSPRec;
+
+/* async functions */
+struct _GstRTSPWatch
+{
+ GSource source;
+
+ GstRTSPConnection *conn;
+
+ GstRTSPBuilder builder;
+ GstRTSPMessage message;
+
+ GPollFD readfd;
+ GPollFD writefd;
+ gboolean write_added;
+
+ /* queued message for transmission */
+ guint id;
+ GAsyncQueue *messages;
+ guint8 *write_data;
+ guint write_off;
+ guint write_size;
+ guint write_id;
+
+ GstRTSPWatchFuncs funcs;
+
+ gpointer user_data;
+ GDestroyNotify notify;
+};
+
+static gboolean
+gst_rtsp_source_prepare (GSource * source, gint * timeout)
+{
+ GstRTSPWatch *watch = (GstRTSPWatch *) source;
+
+ *timeout = (watch->conn->timeout * 1000);
+
+ return FALSE;
+}
+
+static gboolean
+gst_rtsp_source_check (GSource * source)
+{
+ GstRTSPWatch *watch = (GstRTSPWatch *) source;
+
+ if (watch->readfd.revents & READ_COND)
+ return TRUE;
+
+ if (watch->writefd.revents & WRITE_COND)
+ return TRUE;
+
+ return FALSE;
+}
+
+static gboolean
+gst_rtsp_source_dispatch (GSource * source, GSourceFunc callback G_GNUC_UNUSED,
+ gpointer user_data G_GNUC_UNUSED)
+{
+ GstRTSPWatch *watch = (GstRTSPWatch *) source;
+ GstRTSPResult res;
+
+ /* first read as much as we can */
+ if (watch->readfd.revents & READ_COND) {
+ do {
+ res = build_next (&watch->builder, &watch->message, watch->conn);
+ if (res == GST_RTSP_EINTR)
+ break;
+ if (G_UNLIKELY (res == GST_RTSP_EEOF))
+ goto eof;
+ if (res == GST_RTSP_ETGET) {
+ GString *str;
+ GstRTSPStatusCode code;
+ guint size;
+
+ if (watch->funcs.tunnel_start)
+ code = watch->funcs.tunnel_start (watch, watch->user_data);
+ else
+ code = GST_RTSP_STS_OK;
+
+ /* queue the response string */
+ str = gen_tunnel_reply (watch->conn, code);
+ size = str->len;
+ gst_rtsp_watch_queue_data (watch, (guint8 *) g_string_free (str, FALSE),
+ size);
+ } else if (res == GST_RTSP_ETPOST) {
+ /* in the callback the connection should be tunneled with the
+ * GET connection */
+ if (watch->funcs.tunnel_complete)
+ watch->funcs.tunnel_complete (watch, watch->user_data);
+ } else if (G_UNLIKELY (res != GST_RTSP_OK))
+ goto error;
+
+ if (G_LIKELY (res == GST_RTSP_OK)) {
+ if (watch->funcs.message_received)
+ watch->funcs.message_received (watch, &watch->message,
+ watch->user_data);
+
+ gst_rtsp_message_unset (&watch->message);
+ }
+ build_reset (&watch->builder);
+ } while (FALSE);
+ }
+
+ if (watch->writefd.revents & WRITE_COND) {
+ do {
+ if (watch->write_data == NULL) {
+ GstRTSPRec *rec;
+
+ /* get a new message from the queue */
+ rec = g_async_queue_try_pop (watch->messages);
+ if (rec == NULL)
+ goto done;
+
+ watch->write_off = 0;
+ watch->write_data = rec->data;
+ watch->write_size = rec->size;
+ watch->write_id = rec->id;
+
+ g_slice_free (GstRTSPRec, rec);
+ }
+
+ res = write_bytes (watch->writefd.fd, watch->write_data,
+ &watch->write_off, watch->write_size);
+ if (res == GST_RTSP_EINTR)
+ break;
+ if (G_UNLIKELY (res != GST_RTSP_OK))
+ goto error;
+
+ if (watch->funcs.message_sent)
+ watch->funcs.message_sent (watch, watch->write_id, watch->user_data);
+
+ done:
+ if (g_async_queue_length (watch->messages) == 0 && watch->write_added) {
+ g_source_remove_poll ((GSource *) watch, &watch->writefd);
+ watch->write_added = FALSE;
+ watch->writefd.revents = 0;
+ }
+ g_free (watch->write_data);
+ watch->write_data = NULL;
+ } while (FALSE);
+ }
+
+ return TRUE;
+
+ /* ERRORS */
+eof:
+ {
+ if (watch->funcs.closed)
+ watch->funcs.closed (watch, watch->user_data);
+ return FALSE;
+ }
+error:
+ {
+ if (watch->funcs.error)
+ watch->funcs.error (watch, res, watch->user_data);
+ return FALSE;
+ }
+}
+
+static void
+gst_rtsp_rec_free (gpointer data)
+{
+ GstRTSPRec *rec = data;
+
+ g_free (rec->data);
+ g_slice_free (GstRTSPRec, rec);
+}
+
+static void
+gst_rtsp_source_finalize (GSource * source)
+{
+ GstRTSPWatch *watch = (GstRTSPWatch *) source;
+
+ build_reset (&watch->builder);
+ gst_rtsp_message_unset (&watch->message);
+
+ g_async_queue_unref (watch->messages);
+ watch->messages = NULL;
+
+ g_free (watch->write_data);
+
+ if (watch->notify)
+ watch->notify (watch->user_data);
+}
+
+static GSourceFuncs gst_rtsp_source_funcs = {
+ gst_rtsp_source_prepare,
+ gst_rtsp_source_check,
+ gst_rtsp_source_dispatch,
+ gst_rtsp_source_finalize,
+ NULL,
+ NULL
+};
+
+/**
+ * gst_rtsp_watch_new:
+ * @conn: a #GstRTSPConnection
+ * @funcs: watch functions
+ * @user_data: user data to pass to @funcs
+ * @notify: notify when @user_data is not referenced anymore
+ *
+ * Create a watch object for @conn. The functions provided in @funcs will be
+ * called with @user_data when activity happened on the watch.
+ *
+ * The new watch is usually created so that it can be attached to a
+ * maincontext with gst_rtsp_watch_attach().
+ *
+ * @conn must exist for the entire lifetime of the watch.
+ *
+ * Returns: a #GstRTSPWatch that can be used for asynchronous RTSP
+ * communication. Free with gst_rtsp_watch_unref () after usage.
+ *
+ * Since: 0.10.23
+ */
+GstRTSPWatch *
+gst_rtsp_watch_new (GstRTSPConnection * conn,
+ GstRTSPWatchFuncs * funcs, gpointer user_data, GDestroyNotify notify)
+{
+ GstRTSPWatch *result;
+
+ g_return_val_if_fail (conn != NULL, NULL);
+ g_return_val_if_fail (funcs != NULL, NULL);
+ g_return_val_if_fail (conn->readfd != NULL, NULL);
+ g_return_val_if_fail (conn->writefd != NULL, NULL);
+
+ result = (GstRTSPWatch *) g_source_new (&gst_rtsp_source_funcs,
+ sizeof (GstRTSPWatch));
+
+ result->conn = conn;
+ result->builder.state = STATE_START;
+
+ result->messages = g_async_queue_new_full (gst_rtsp_rec_free);
+
+ result->readfd.fd = -1;
+ result->writefd.fd = -1;
+
+ gst_rtsp_watch_reset (result);
+
+ result->funcs = *funcs;
+ result->user_data = user_data;
+ result->notify = notify;
+
+ /* only add the read fd, the write fd is only added when we have data
+ * to send. */
+ g_source_add_poll ((GSource *) result, &result->readfd);
+
+ return result;
+}
+
+/**
+ * gst_rtsp_watch_reset:
+ * @watch: a #GstRTSPWatch
+ *
+ * Reset @watch, this is usually called after gst_rtsp_connection_do_tunnel()
+ * when the file descriptors of the connection might have changed.
+ *
+ * Since: 0.10.23
+ */
+void
+gst_rtsp_watch_reset (GstRTSPWatch * watch)
+{
+ if (watch->readfd.fd != -1)
+ g_source_remove_poll ((GSource *) watch, &watch->readfd);
+ if (watch->writefd.fd != -1)
+ g_source_remove_poll ((GSource *) watch, &watch->writefd);
+
+ watch->readfd.fd = watch->conn->readfd->fd;
+ watch->readfd.events = READ_COND;
+ watch->readfd.revents = 0;
+
+ watch->writefd.fd = watch->conn->writefd->fd;
+ watch->writefd.events = WRITE_COND;
+ watch->writefd.revents = 0;
+ watch->write_added = FALSE;
+
+ g_source_add_poll ((GSource *) watch, &watch->readfd);
+}
+
+/**
+ * gst_rtsp_watch_attach:
+ * @watch: a #GstRTSPWatch
+ * @context: a GMainContext (if NULL, the default context will be used)
+ *
+ * Adds a #GstRTSPWatch to a context so that it will be executed within that context.
+ *
+ * Returns: the ID (greater than 0) for the watch within the GMainContext.
+ *
+ * Since: 0.10.23
+ */
+guint
+gst_rtsp_watch_attach (GstRTSPWatch * watch, GMainContext * context)
+{
+ g_return_val_if_fail (watch != NULL, 0);
+
+ return g_source_attach ((GSource *) watch, context);
+}
+
+/**
+ * gst_rtsp_watch_unref:
+ * @watch: a #GstRTSPWatch
+ *
+ * Decreases the reference count of @watch by one. If the resulting reference
+ * count is zero the watch and associated memory will be destroyed.
+ *
+ * Since: 0.10.23
+ */
+void
+gst_rtsp_watch_unref (GstRTSPWatch * watch)
+{
+ g_return_if_fail (watch != NULL);
+
+ g_source_unref ((GSource *) watch);
+}
+
+/**
+ * gst_rtsp_watch_queue_data:
+ * @watch: a #GstRTSPWatch
+ * @data: the data to queue
+ * @size: the size of @data
+ *
+ * Queue @data for transmission in @watch. It will be transmitted when the
+ * connection of the @watch becomes writable.
+ *
+ * This function will take ownership of @data and g_free() it after use.
+ *
+ * The return value of this function will be used as the id argument in the
+ * message_sent callback.
+ *
+ * Returns: an id.
+ *
+ * Since: 0.10.24
+ */
+guint
+gst_rtsp_watch_queue_data (GstRTSPWatch * watch, const guint8 * data,
+ guint size)
+{
+ GstRTSPRec *rec;
+
+ g_return_val_if_fail (watch != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (data != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (size != 0, GST_RTSP_EINVAL);
+
+ /* make a record with the data and id */
+ rec = g_slice_new (GstRTSPRec);
+ rec->data = (guint8 *) data;
+ rec->size = size;
+ do {
+ /* make sure rec->id is never 0 */
+ rec->id = ++watch->id;
+ } while (G_UNLIKELY (rec->id == 0));
+
+ /* add the record to a queue. FIXME we would like to have an upper limit here */
+ g_async_queue_push (watch->messages, rec);
+
+ /* FIXME: does the following need to be made thread-safe? (this might be
+ * called from a streaming thread, like appsink's render function) */
+ /* make sure the main context will now also check for writability on the
+ * socket */
+ if (!watch->write_added) {
+ g_source_add_poll ((GSource *) watch, &watch->writefd);
+ watch->write_added = TRUE;
+ }
+
+ return rec->id;
+}
+
+/**
+ * gst_rtsp_watch_queue_message:
+ * @watch: a #GstRTSPWatch
+ * @message: a #GstRTSPMessage
+ *
+ * Queue a @message for transmission in @watch. The contents of this
+ * message will be serialized and transmitted when the connection of the
+ * @watch becomes writable.
+ *
+ * The return value of this function will be used as the id argument in the
+ * message_sent callback.
+ *
+ * Returns: an id.
+ *
+ * Since: 0.10.23
+ */
+guint
+gst_rtsp_watch_queue_message (GstRTSPWatch * watch, GstRTSPMessage * message)
+{
+ GString *str;
+ guint size;
+
+ g_return_val_if_fail (watch != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (message != NULL, GST_RTSP_EINVAL);
+
+ /* make a record with the message as a string and id */
+ str = message_to_string (watch->conn, message);
+ size = str->len;
+ return gst_rtsp_watch_queue_data (watch,
+ (guint8 *) g_string_free (str, FALSE), size);
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspconnection.h
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspconnection.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspconnection.h Wed Mar 24 18:04:17 2010 -0500
@@ -1,5 +1,5 @@
/* GStreamer
- * Copyright (C) <2005,2006> Wim Taymans
+ * Copyright (C) <2005,2009> Wim Taymans
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -45,48 +45,28 @@
#include
+#include
#include
#include
#include
G_BEGIN_DECLS
-typedef struct _GstRTSPConnection GstRTSPConnection;
-
/**
* GstRTSPConnection:
*
* Opaque RTSP connection object.
*/
-struct _GstRTSPConnection
-{
- /*< private >*/
- /* URL for the connection */
- GstRTSPUrl *url;
-
- /* connection state */
- GstPollFD fd;
- GstPoll *fdset;
- gchar *ip;
-
- /* Session state */
- gint cseq; /* sequence number */
- gchar session_id[512]; /* session id */
- gint timeout; /* session timeout in seconds */
- GTimer *timer; /* timeout timer */
-
- /* Authentication */
- GstRTSPAuthMethod auth_method;
- gchar *username;
- gchar *passwd;
-};
+typedef struct _GstRTSPConnection GstRTSPConnection;
/* opening/closing a connection */
-GstRTSPResult gst_rtsp_connection_create (GstRTSPUrl *url, GstRTSPConnection **conn);
+GstRTSPResult gst_rtsp_connection_create (const GstRTSPUrl *url, GstRTSPConnection **conn);
+GstRTSPResult gst_rtsp_connection_accept (gint sock, GstRTSPConnection **conn);
GstRTSPResult gst_rtsp_connection_connect (GstRTSPConnection *conn, GTimeVal *timeout);
GstRTSPResult gst_rtsp_connection_close (GstRTSPConnection *conn);
GstRTSPResult gst_rtsp_connection_free (GstRTSPConnection *conn);
+
/* sending/receiving raw bytes */
GstRTSPResult gst_rtsp_connection_read (GstRTSPConnection * conn, guint8 * data,
guint size, GTimeVal * timeout);
@@ -110,10 +90,95 @@
/* flushing state */
GstRTSPResult gst_rtsp_connection_flush (GstRTSPConnection *conn, gboolean flush);
-/* Configure Authentication data */
+/* HTTP proxy support */
+GstRTSPResult gst_rtsp_connection_set_proxy (GstRTSPConnection *conn,
+ const gchar *host, guint port);
+
+/* configure authentication data */
GstRTSPResult gst_rtsp_connection_set_auth (GstRTSPConnection *conn, GstRTSPAuthMethod method,
const gchar *user, const gchar *pass);
+void gst_rtsp_connection_set_auth_param (GstRTSPConnection *conn,
+ const gchar * param,
+ const gchar *value);
+void gst_rtsp_connection_clear_auth_params (GstRTSPConnection *conn);
+
+/* configure DSCP */
+GstRTSPResult gst_rtsp_connection_set_qos_dscp (GstRTSPConnection *conn,
+ guint qos_dscp);
+
+/* accessors */
+GstRTSPUrl * gst_rtsp_connection_get_url (const GstRTSPConnection *conn);
+const gchar * gst_rtsp_connection_get_ip (const GstRTSPConnection *conn);
+void gst_rtsp_connection_set_ip (GstRTSPConnection *conn, const gchar *ip);
+
+gint gst_rtsp_connection_get_readfd (const GstRTSPConnection *conn);
+gint gst_rtsp_connection_get_writefd (const GstRTSPConnection *conn);
+
+/* tunneling */
+void gst_rtsp_connection_set_tunneled (GstRTSPConnection *conn, gboolean tunneled);
+gboolean gst_rtsp_connection_is_tunneled (const GstRTSPConnection *conn);
+
+const gchar * gst_rtsp_connection_get_tunnelid (const GstRTSPConnection *conn);
+GstRTSPResult gst_rtsp_connection_do_tunnel (GstRTSPConnection *conn, GstRTSPConnection *conn2);
+
+/* async IO */
+
+/**
+ * GstRTSPWatch:
+ *
+ * Opaque RTSP watch object that can be used for asynchronous RTSP
+ * operations.
+ */
+typedef struct _GstRTSPWatch GstRTSPWatch;
+
+/**
+ * GstRTSPWatchFuncs:
+ * @message_received: callback when a message was received
+ * @message_sent: callback when a message was sent
+ * @closed: callback when the connection is closed
+ * @error: callback when an error occured
+ * @tunnel_start: a client started a tunneled connection. The tunnelid of the
+ * connection must be saved.
+ * @tunnel_complete: a client finished a tunneled connection. In this callback
+ * you usually pair the tunnelid of this connection with the saved one using
+ * gst_rtsp_connection_do_tunnel().
+ *
+ * Callback functions from a #GstRTSPWatch.
+ *
+ * Since: 0.10.23
+ */
+typedef struct {
+ GstRTSPResult (*message_received) (GstRTSPWatch *watch, GstRTSPMessage *message,
+ gpointer user_data);
+ GstRTSPResult (*message_sent) (GstRTSPWatch *watch, guint id,
+ gpointer user_data);
+ GstRTSPResult (*closed) (GstRTSPWatch *watch, gpointer user_data);
+ GstRTSPResult (*error) (GstRTSPWatch *watch, GstRTSPResult result,
+ gpointer user_data);
+ GstRTSPStatusCode (*tunnel_start) (GstRTSPWatch *watch, gpointer user_data);
+ GstRTSPResult (*tunnel_complete) (GstRTSPWatch *watch, gpointer user_data);
+
+ /*< private >*/
+ gpointer _gst_reserved[GST_PADDING];
+} GstRTSPWatchFuncs;
+
+GstRTSPWatch * gst_rtsp_watch_new (GstRTSPConnection *conn,
+ GstRTSPWatchFuncs *funcs,
+ gpointer user_data,
+ GDestroyNotify notify);
+void gst_rtsp_watch_reset (GstRTSPWatch *watch);
+void gst_rtsp_watch_unref (GstRTSPWatch *watch);
+
+guint gst_rtsp_watch_attach (GstRTSPWatch *watch,
+ GMainContext *context);
+
+guint gst_rtsp_watch_queue_data (GstRTSPWatch * watch,
+ const guint8 * data,
+ guint size);
+guint gst_rtsp_watch_queue_message (GstRTSPWatch *watch,
+ GstRTSPMessage *message);
+
G_END_DECLS
#endif /* __GST_RTSP_CONNECTION_H__ */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspdefs.c
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspdefs.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspdefs.c Wed Mar 24 18:04:17 2010 -0500
@@ -60,7 +60,9 @@
#include "gstrtspdefs.h"
-#ifndef G_OS_WIN32
+#ifdef G_OS_WIN32
+#include
+#else
#include
#endif
@@ -81,6 +83,8 @@
"Network error: %s",
"Host is not a valid IP address",
"Timeout while waiting for server response",
+ "Tunnel GET request received",
+ "Tunnel POST request received",
"Unknown error (%d)",
NULL
};
@@ -157,6 +161,30 @@
"PlayerStarttime", /* PlayerStarttime */
"Location", /* Location */
+ "ETag", /* ETag */
+ "If-Match", /* If-Match */
+
+ /* WM extensions [MS-RTSP] */
+ "Accept-Charset", /* Accept-Charset */
+ "Supported", /* Supported */
+ "Vary", /* Vary */
+ "X-Accelerate-Streaming", /* X-Accelerate-Streaming */
+ "X-Accept-Authentication", /* X-Accept-Authentication */
+ "X-Accept-Proxy-Authentication", /* X-Accept-Proxy-Authentication */
+ "X-Broadcast-Id", /* X-Broadcast-Id */
+ "X-Burst-Streaming", /* X-Burst-Streaming */
+ "X-Notice", /* X-Notice */
+ "X-Player-Lag-Time", /* X-Player-Lag-Time */
+ "X-Playlist", /* X-Playlist */
+ "X-Playlist-Change-Notice", /* X-Playlist-Change-Notice */
+ "X-Playlist-Gen-Id", /* X-Playlist-Gen-Id */
+ "X-Playlist-Seek-Id", /* X-Playlist-Seek-Id */
+ "X-Proxy-Client-Agent", /* X-Proxy-Client-Agent */
+ "X-Proxy-Client-Verb", /* X-Proxy-Client-Verb */
+ "X-Receding-PlaylistChange", /* X-Receding-PlaylistChange */
+ "X-RTP-Info", /* X-RTP-Info */
+ "X-StartupProfile", /* X-StartupProfile */
+ "Timestamp", /* Timestamp */
NULL
};
@@ -243,16 +271,21 @@
idx = CLAMP (idx, 0, -GST_RTSP_ELAST);
switch (idx) {
+#ifdef G_OS_WIN32
+ case -GST_RTSP_ESYS:
+ case -GST_RTSP_ENET:
+ {
+ gchar *msg = g_win32_error_message (WSAGetLastError ());
+ res = g_strdup_printf (rtsp_results[idx], msg);
+ g_free (msg);
+ break;
+ }
+#else
case -GST_RTSP_ESYS:
res = g_strdup_printf (rtsp_results[idx], g_strerror (errno));
break;
case -GST_RTSP_ENET:
-#ifndef G_OS_WIN32
res = g_strdup_printf (rtsp_results[idx], hstrerror (h_errno));
-#else
- res =
- g_strdup
- ("not supported on win32, implement me in a different way ??");
#endif
break;
case -GST_RTSP_ELAST:
@@ -388,3 +421,50 @@
}
return GST_RTSP_INVALID;
}
+
+/**
+ * gst_rtsp_options_as_text:
+ * @options: one or more #GstRTSPMethod
+ *
+ * Convert @options to a string.
+ *
+ * Returns: a new string of @options. g_free() after usage.
+ *
+ * Since: 0.10.23
+ */
+gchar *
+gst_rtsp_options_as_text (GstRTSPMethod options)
+{
+ GString *str;
+
+ str = g_string_new ("");
+
+ if (options & GST_RTSP_OPTIONS)
+ g_string_append (str, "OPTIONS, ");
+ if (options & GST_RTSP_DESCRIBE)
+ g_string_append (str, "DESCRIBE, ");
+ if (options & GST_RTSP_ANNOUNCE)
+ g_string_append (str, "ANNOUNCE, ");
+ if (options & GST_RTSP_GET_PARAMETER)
+ g_string_append (str, "GET_PARAMETER, ");
+ if (options & GST_RTSP_PAUSE)
+ g_string_append (str, "PAUSE, ");
+ if (options & GST_RTSP_PLAY)
+ g_string_append (str, "PLAY, ");
+ if (options & GST_RTSP_RECORD)
+ g_string_append (str, "RECORD, ");
+ if (options & GST_RTSP_REDIRECT)
+ g_string_append (str, "REDIRECT, ");
+ if (options & GST_RTSP_SETUP)
+ g_string_append (str, "SETUP, ");
+ if (options & GST_RTSP_SET_PARAMETER)
+ g_string_append (str, "SET_PARAMETER, ");
+ if (options & GST_RTSP_TEARDOWN)
+ g_string_append (str, "TEARDOWN, ");
+
+ /* remove trailing ", " if there is one */
+ if (str->len > 2)
+ str = g_string_truncate (str, str->len - 2);
+
+ return g_string_free (str, FALSE);
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspdefs.h
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspdefs.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspdefs.h Wed Mar 24 18:04:17 2010 -0500
@@ -78,6 +78,8 @@
* @GST_RTSP_ENET: a network problem occured, h_errno contains more details
* @GST_RTSP_ENOTIP: the host is not an IP host
* @GST_RTSP_ETIMEOUT: a timeout occured
+ * @GST_RTSP_ETGET: the tunnel GET request has been performed
+ * @GST_RTSP_ETPOST: the tunnel POST request has been performed
* @GST_RTSP_ELAST: last error
*
* Result codes from the RTSP functions.
@@ -99,8 +101,10 @@
GST_RTSP_ENET = -12,
GST_RTSP_ENOTIP = -13,
GST_RTSP_ETIMEOUT = -14,
+ GST_RTSP_ETGET = -15,
+ GST_RTSP_ETPOST = -16,
- GST_RTSP_ELAST = -15
+ GST_RTSP_ELAST = -17
} GstRTSPResult;
/**
@@ -279,7 +283,35 @@
GST_RTSP_HDR_PLAYER_START_TIME, /* PlayerStarttime */
/* Since 0.10.16 */
- GST_RTSP_HDR_LOCATION /* Location */
+ GST_RTSP_HDR_LOCATION, /* Location */
+
+ /* Since 0.10.23 */
+ GST_RTSP_HDR_ETAG, /* ETag */
+ GST_RTSP_HDR_IF_MATCH, /* If-Match */
+
+ /* WM extensions [MS-RTSP] Since 0.10.23 */
+ GST_RTSP_HDR_ACCEPT_CHARSET, /* Accept-Charset */
+ GST_RTSP_HDR_SUPPORTED, /* Supported */
+ GST_RTSP_HDR_VARY, /* Vary */
+ GST_RTSP_HDR_X_ACCELERATE_STREAMING, /* X-Accelerate-Streaming */
+ GST_RTSP_HDR_X_ACCEPT_AUTHENT, /* X-Accept-Authentication */
+ GST_RTSP_HDR_X_ACCEPT_PROXY_AUTHENT, /* X-Accept-Proxy-Authentication */
+ GST_RTSP_HDR_X_BROADCAST_ID, /* X-Broadcast-Id */
+ GST_RTSP_HDR_X_BURST_STREAMING, /* X-Burst-Streaming */
+ GST_RTSP_HDR_X_NOTICE, /* X-Notice */
+ GST_RTSP_HDR_X_PLAYER_LAG_TIME, /* X-Player-Lag-Time */
+ GST_RTSP_HDR_X_PLAYLIST, /* X-Playlist */
+ GST_RTSP_HDR_X_PLAYLIST_CHANGE_NOTICE, /* X-Playlist-Change-Notice */
+ GST_RTSP_HDR_X_PLAYLIST_GEN_ID, /* X-Playlist-Gen-Id */
+ GST_RTSP_HDR_X_PLAYLIST_SEEK_ID, /* X-Playlist-Seek-Id */
+ GST_RTSP_HDR_X_PROXY_CLIENT_AGENT, /* X-Proxy-Client-Agent */
+ GST_RTSP_HDR_X_PROXY_CLIENT_VERB, /* X-Proxy-Client-Verb */
+ GST_RTSP_HDR_X_RECEDING_PLAYLISTCHANGE, /* X-Receding-PlaylistChange */
+ GST_RTSP_HDR_X_RTP_INFO, /* X-RTP-Info */
+ GST_RTSP_HDR_X_STARTUPPROFILE, /* X-StartupProfile */
+
+ /* Since 0.10.24 */
+ GST_RTSP_HDR_TIMESTAMP /* Timestamp */
} GstRTSPHeaderField;
@@ -338,6 +370,8 @@
const gchar* gst_rtsp_header_as_text (GstRTSPHeaderField field);
const gchar* gst_rtsp_status_as_text (GstRTSPStatusCode code);
+gchar* gst_rtsp_options_as_text (GstRTSPMethod options);
+
GstRTSPHeaderField gst_rtsp_find_header_field (const gchar *header);
GstRTSPMethod gst_rtsp_find_method (const gchar *method);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspextension.c
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspextension.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspextension.c Wed Mar 24 18:04:17 2010 -0500
@@ -196,6 +196,20 @@
}
GstRTSPResult
+gst_rtsp_extension_receive_request (GstRTSPExtension * ext,
+ GstRTSPMessage * msg)
+{
+ GstRTSPExtensionInterface *iface;
+ GstRTSPResult res = GST_RTSP_ENOTIMPL;
+
+ iface = GST_RTSP_EXTENSION_GET_IFACE (ext);
+ if (iface->receive_request)
+ res = iface->receive_request (ext, msg);
+
+ return res;
+}
+
+GstRTSPResult
gst_rtsp_extension_send (GstRTSPExtension * ext, GstRTSPMessage * req,
GstRTSPMessage * resp)
{
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspextension.h
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspextension.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspextension.h Wed Mar 24 18:04:17 2010 -0500
@@ -64,8 +64,11 @@
/* signals */
GstRTSPResult (*send) (GstRTSPExtension *ext, GstRTSPMessage *req, GstRTSPMessage *resp);
+ /* ABI: more vfunctions added later */
+ GstRTSPResult (*receive_request) (GstRTSPExtension *ext, GstRTSPMessage *req);
+
/*< private >*/
- gpointer _gst_reserved[GST_PADDING];
+ gpointer _gst_reserved[GST_PADDING - 1];
};
GType gst_rtsp_extension_get_type (void);
@@ -83,6 +86,7 @@
GstRTSPResult gst_rtsp_extension_get_transports (GstRTSPExtension *ext, GstRTSPLowerTrans protocols,
gchar **transport);
GstRTSPResult gst_rtsp_extension_stream_select (GstRTSPExtension *ext, GstRTSPUrl *url);
+GstRTSPResult gst_rtsp_extension_receive_request (GstRTSPExtension *ext, GstRTSPMessage *req);
/* signal emision */
GstRTSPResult gst_rtsp_extension_send (GstRTSPExtension *ext, GstRTSPMessage *req,
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspmessage.c
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspmessage.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspmessage.c Wed Mar 24 18:04:17 2010 -0500
@@ -57,6 +57,7 @@
#include
+#include
#include "gstrtspmessage.h"
typedef struct _RTSPKeyValue
@@ -81,9 +82,9 @@
* gst_rtsp_message_new:
* @msg: a location for the new #GstRTSPMessage
*
- * Create a new initialized #GstRTSPMessage.
+ * Create a new initialized #GstRTSPMessage. Free with gst_rtsp_message_free().
*
- * Returns: a #GstRTSPResult. Free with gst_rtsp_message_free().
+ * Returns: a #GstRTSPResult.
*/
GstRTSPResult
gst_rtsp_message_new (GstRTSPMessage ** msg)
@@ -144,9 +145,9 @@
* @uri: the uri of the request
*
* Create a new #GstRTSPMessage with @method and @uri and store the result
- * request message in @msg.
+ * request message in @msg. Free with gst_rtsp_message_free().
*
- * Returns: a #GstRTSPResult. Free with gst_rtsp_message_free().
+ * Returns: a #GstRTSPResult.
*/
GstRTSPResult
gst_rtsp_message_new_request (GstRTSPMessage ** msg, GstRTSPMethod method,
@@ -213,7 +214,7 @@
GstRTSPMethod * method, const gchar ** uri, GstRTSPVersion * version)
{
g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
- g_return_val_if_fail (msg->type != GST_RTSP_MESSAGE_REQUEST, GST_RTSP_EINVAL);
+ g_return_val_if_fail (msg->type == GST_RTSP_MESSAGE_REQUEST, GST_RTSP_EINVAL);
if (method)
*method = msg->type_data.request.method;
@@ -233,14 +234,14 @@
* @request: the request that triggered the response or #NULL
*
* Create a new response #GstRTSPMessage with @code and @reason and store the
- * result message in @msg.
+ * result message in @msg. Free with gst_rtsp_message_free().
*
* When @reason is #NULL, the default reason for @code will be used.
*
* When @request is not #NULL, the relevant headers will be copied to the new
* response message.
*
- * Returns: a #GstRTSPResult. Free with gst_rtsp_message_free().
+ * Returns: a #GstRTSPResult.
*/
GstRTSPResult
gst_rtsp_message_new_response (GstRTSPMessage ** msg, GstRTSPStatusCode code,
@@ -309,8 +310,7 @@
*pos = '\0';
}
g_strchomp (header);
- gst_rtsp_message_add_header (msg, GST_RTSP_HDR_SESSION, header);
- g_free (header);
+ gst_rtsp_message_take_header (msg, GST_RTSP_HDR_SESSION, header);
}
/* FIXME copy more headers? */
@@ -340,7 +340,7 @@
GstRTSPStatusCode * code, const gchar ** reason, GstRTSPVersion * version)
{
g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
- g_return_val_if_fail (msg->type != GST_RTSP_MESSAGE_RESPONSE,
+ g_return_val_if_fail (msg->type == GST_RTSP_MESSAGE_RESPONSE,
GST_RTSP_EINVAL);
if (code)
@@ -359,9 +359,9 @@
* @channel: the channel
*
* Create a new data #GstRTSPMessage with @channel and store the
- * result message in @msg.
+ * result message in @msg. Free with gst_rtsp_message_free().
*
- * Returns: a #GstRTSPResult. Free with gst_rtsp_message_free().
+ * Returns: a #GstRTSPResult.
*/
GstRTSPResult
gst_rtsp_message_new_data (GstRTSPMessage ** msg, guint8 channel)
@@ -412,7 +412,7 @@
gst_rtsp_message_parse_data (GstRTSPMessage * msg, guint8 * channel)
{
g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
- g_return_val_if_fail (msg->type != GST_RTSP_MESSAGE_DATA, GST_RTSP_EINVAL);
+ g_return_val_if_fail (msg->type == GST_RTSP_MESSAGE_DATA, GST_RTSP_EINVAL);
if (channel)
*channel = msg->type_data.data.channel;
@@ -424,7 +424,7 @@
* gst_rtsp_message_unset:
* @msg: a #GstRTSPMessage
*
- * Unset the concents of @msg so that it becomes an uninitialized
+ * Unset the contents of @msg so that it becomes an uninitialized
* #GstRTSPMessage again. This function is mostly used in combination with
* gst_rtsp_message_init_request(), gst_rtsp_message_init_response() and
* gst_rtsp_message_init_data() on stack allocated #GstRTSPMessage structures.
@@ -463,7 +463,7 @@
}
g_free (msg->body);
- memset (msg, 0, sizeof *msg);
+ memset (msg, 0, sizeof (GstRTSPMessage));
return GST_RTSP_OK;
}
@@ -491,12 +491,43 @@
}
/**
+ * gst_rtsp_message_take_header:
+ * @msg: a #GstRTSPMessage
+ * @field: a #GstRTSPHeaderField
+ * @value: the value of the header
+ *
+ * Add a header with key @field and @value to @msg. This function takes
+ * ownership of @value.
+ *
+ * Returns: a #GstRTSPResult.
+ *
+ * Since: 0.10.23
+ */
+GstRTSPResult
+gst_rtsp_message_take_header (GstRTSPMessage * msg, GstRTSPHeaderField field,
+ gchar * value)
+{
+ RTSPKeyValue key_value;
+
+ g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
+ g_return_val_if_fail (value != NULL, GST_RTSP_EINVAL);
+
+ key_value.field = field;
+ key_value.value = value;
+
+ g_array_append_val (msg->hdr_fields, key_value);
+
+ return GST_RTSP_OK;
+}
+
+/**
* gst_rtsp_message_add_header:
* @msg: a #GstRTSPMessage
* @field: a #GstRTSPHeaderField
* @value: the value of the header
*
- * Add a header with key @field and @value to @msg.
+ * Add a header with key @field and @value to @msg. This function takes a copy
+ * of @value.
*
* Returns: a #GstRTSPResult.
*/
@@ -504,17 +535,7 @@
gst_rtsp_message_add_header (GstRTSPMessage * msg, GstRTSPHeaderField field,
const gchar * value)
{
- RTSPKeyValue key_value;
-
- g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
- g_return_val_if_fail (value != NULL, GST_RTSP_EINVAL);
-
- key_value.field = field;
- key_value.value = g_strdup (value);
-
- g_array_append_val (msg->hdr_fields, key_value);
-
- return GST_RTSP_OK;
+ return gst_rtsp_message_take_header (msg, field, g_strdup (value));
}
/**
@@ -539,9 +560,10 @@
g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
while (i < msg->hdr_fields->len) {
- RTSPKeyValue key_value = g_array_index (msg->hdr_fields, RTSPKeyValue, i);
+ RTSPKeyValue *key_value = &g_array_index (msg->hdr_fields, RTSPKeyValue, i);
- if (key_value.field == field && (indx == -1 || cnt++ == indx)) {
+ if (key_value->field == field && (indx == -1 || cnt++ == indx)) {
+ g_free (key_value->value);
g_array_remove_index (msg->hdr_fields, i);
res = GST_RTSP_OK;
if (indx != -1)
@@ -560,7 +582,8 @@
* @value: pointer to hold the result
* @indx: the index of the header
*
- * Get the @indx header value with key @field from @msg.
+ * Get the @indx header value with key @field from @msg. The result in @value
+ * stays valid as long as it remains present in @msg.
*
* Returns: #GST_RTSP_OK when @field was found, #GST_RTSP_ENOTIMPL if the key
* was not found.
@@ -574,12 +597,16 @@
g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
- for (i = 0; i < msg->hdr_fields->len; i++) {
- RTSPKeyValue key_value = g_array_index (msg->hdr_fields, RTSPKeyValue, i);
+ /* no header initialized, there are no headers */
+ if (msg->hdr_fields == NULL)
+ return GST_RTSP_ENOTIMPL;
- if (key_value.field == field && cnt++ == indx) {
+ for (i = 0; i < msg->hdr_fields->len; i++) {
+ RTSPKeyValue *key_value = &g_array_index (msg->hdr_fields, RTSPKeyValue, i);
+
+ if (key_value->field == field && cnt++ == indx) {
if (value)
- *value = key_value.value;
+ *value = key_value->value;
return GST_RTSP_OK;
}
}
@@ -606,10 +633,13 @@
g_return_val_if_fail (str != NULL, GST_RTSP_EINVAL);
for (i = 0; i < msg->hdr_fields->len; i++) {
- RTSPKeyValue key_value = g_array_index (msg->hdr_fields, RTSPKeyValue, i);
- const gchar *keystr = gst_rtsp_header_as_text (key_value.field);
+ RTSPKeyValue *key_value;
+ const gchar *keystr;
- g_string_append_printf (str, "%s: %s\r\n", keystr, key_value.value);
+ key_value = &g_array_index (msg->hdr_fields, RTSPKeyValue, i);
+ keystr = gst_rtsp_header_as_text (key_value->field);
+
+ g_string_append_printf (str, "%s: %s\r\n", keystr, key_value->value);
}
return GST_RTSP_OK;
}
@@ -712,38 +742,7 @@
}
static void
-dump_mem (guint8 * mem, guint size)
-{
- guint i, j;
- GString *string = g_string_sized_new (50);
- GString *chars = g_string_sized_new (18);
-
- i = j = 0;
- while (i < size) {
- if (g_ascii_isprint (mem[i]))
- g_string_append_printf (chars, "%c", mem[i]);
- else
- g_string_append_printf (chars, ".");
-
- g_string_append_printf (string, "%02x ", mem[i]);
-
- j++;
- i++;
-
- if (j == 16 || i == size) {
- g_print ("%08x (%p): %-48.48s %-16.16s\n", i - j, mem + i - j,
- string->str, chars->str);
- g_string_set_size (string, 0);
- g_string_set_size (chars, 0);
- j = 0;
- }
- }
- g_string_free (string, TRUE);
- g_string_free (chars, TRUE);
-}
-
-static void
-dump_key_value (gpointer data, gpointer user_data)
+dump_key_value (gpointer data, gpointer user_data G_GNUC_UNUSED)
{
RTSPKeyValue *key_value = (RTSPKeyValue *) data;
@@ -780,7 +779,7 @@
key_value_foreach (msg->hdr_fields, dump_key_value, NULL);
g_print (" body:\n");
gst_rtsp_message_get_body (msg, &data, &size);
- dump_mem (data, size);
+ gst_util_dump_mem (data, size);
break;
case GST_RTSP_MESSAGE_RESPONSE:
g_print ("RTSP response message %p\n", msg);
@@ -793,14 +792,14 @@
key_value_foreach (msg->hdr_fields, dump_key_value, NULL);
gst_rtsp_message_get_body (msg, &data, &size);
g_print (" body: length %d\n", size);
- dump_mem (data, size);
+ gst_util_dump_mem (data, size);
break;
case GST_RTSP_MESSAGE_DATA:
g_print ("RTSP data message %p\n", msg);
g_print (" channel: '%d'\n", msg->type_data.data.channel);
g_print (" size: '%d'\n", msg->body_size);
gst_rtsp_message_get_body (msg, &data, &size);
- dump_mem (data, size);
+ gst_util_dump_mem (data, size);
break;
default:
g_print ("unsupported message type %d\n", msg->type);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspmessage.h
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspmessage.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspmessage.h Wed Mar 24 18:04:17 2010 -0500
@@ -63,7 +63,7 @@
GST_RTSP_MESSAGE_INVALID,
GST_RTSP_MESSAGE_REQUEST,
GST_RTSP_MESSAGE_RESPONSE,
- GST_RTSP_MESSAGE_DATA,
+ GST_RTSP_MESSAGE_DATA
} GstRTSPMsgType;
typedef struct _GstRTSPMessage GstRTSPMessage;
@@ -147,6 +147,9 @@
GstRTSPResult gst_rtsp_message_add_header (GstRTSPMessage *msg,
GstRTSPHeaderField field,
const gchar *value);
+GstRTSPResult gst_rtsp_message_take_header (GstRTSPMessage *msg,
+ GstRTSPHeaderField field,
+ gchar *value);
GstRTSPResult gst_rtsp_message_remove_header (GstRTSPMessage *msg,
GstRTSPHeaderField field,
gint indx);
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtsprange.c
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtsprange.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtsprange.c Wed Mar 24 18:04:17 2010 -0500
@@ -69,7 +69,7 @@
static GstRTSPResult
parse_npt_time (const gchar * str, GstRTSPTime * time)
{
- if (strcmp (str, "now") == 0) {
+ if (strncmp (str, "now", 3) == 0) {
time->type = GST_RTSP_TIME_NOW;
} else if (str[0] == '\0') {
time->type = GST_RTSP_TIME_END;
@@ -167,9 +167,10 @@
} else
goto invalid;
- if (ret == GST_RTSP_OK)
- *range = res;
+ if (ret != GST_RTSP_OK)
+ goto invalid;
+ *range = res;
return ret;
/* ERRORS */
@@ -180,6 +181,88 @@
}
}
+static gboolean
+npt_time_string (const GstRTSPTime * time, GString * string)
+{
+ gboolean res = TRUE;;
+
+ switch (time->type) {
+ case GST_RTSP_TIME_SECONDS:
+ g_string_append_printf (string, "%f", time->seconds);
+ break;
+ case GST_RTSP_TIME_NOW:
+ g_string_append (string, "now");
+ break;
+ case GST_RTSP_TIME_END:
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ return res;
+}
+
+static gboolean
+npt_range_string (const GstRTSPTimeRange * range, GString * string)
+{
+ gboolean res;
+
+ if (!(res = npt_time_string (&range->min, string)))
+ goto done;
+
+ g_string_append (string, "-");
+
+ if (!(res = npt_time_string (&range->max, string)))
+ goto done;
+
+done:
+ return res;
+}
+
+/**
+ * gst_rtsp_range_to_string:
+ * @range: a #GstRTSPTimeRange
+ *
+ * Convert @range into a string representation.
+ *
+ * Returns: The string representation of @range. g_free() after usage.
+ *
+ * Since: 0.10.23
+ */
+gchar *
+gst_rtsp_range_to_string (const GstRTSPTimeRange * range)
+{
+ gchar *result = NULL;
+ GString *string;
+
+ g_return_val_if_fail (range != NULL, NULL);
+
+ string = g_string_new ("");
+
+ switch (range->unit) {
+ case GST_RTSP_RANGE_NPT:
+ g_string_append (string, "npt=");
+ if (!npt_range_string (range, string)) {
+ g_string_free (string, TRUE);
+ string = NULL;
+ }
+ break;
+ case GST_RTSP_RANGE_SMPTE:
+ case GST_RTSP_RANGE_SMPTE_30_DROP:
+ case GST_RTSP_RANGE_SMPTE_25:
+ case GST_RTSP_RANGE_CLOCK:
+ default:
+ g_warning ("time range unit not yet implemented");
+ g_string_free (string, TRUE);
+ string = NULL;
+ break;
+ }
+ if (string)
+ result = g_string_free (string, FALSE);
+
+ return result;
+}
+
/**
* gst_rtsp_range_free:
* @range: a #GstRTSPTimeRange
@@ -189,8 +272,5 @@
void
gst_rtsp_range_free (GstRTSPTimeRange * range)
{
- if (range == NULL)
- return;
-
g_free (range);
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtsprange.h
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtsprange.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtsprange.h Wed Mar 24 18:04:17 2010 -0500
@@ -113,6 +113,7 @@
};
GstRTSPResult gst_rtsp_range_parse (const gchar *rangestr, GstRTSPTimeRange **range);
+gchar * gst_rtsp_range_to_string (const GstRTSPTimeRange *range);
void gst_rtsp_range_free (GstRTSPTimeRange *range);
G_END_DECLS
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtsptransport.c
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtsptransport.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtsptransport.c Wed Mar 24 18:04:17 2010 -0500
@@ -544,6 +544,7 @@
if ((tmp = rtsp_transport_ltrans_as_text (transport)) == NULL)
goto invalid_transport;
+
g_ptr_array_add (strs, g_ascii_strup (tmp, -1));
}
@@ -601,32 +602,36 @@
}
/* add the port parameter */
- if (transport->trans == GST_RTSP_TRANS_RTP && transport->port.min >= 0) {
- if (transport->port.min < 65536 && transport->port.max < 65536) {
- g_ptr_array_add (strs, g_strdup (";port="));
- g_ptr_array_add (strs, range_as_text (&transport->port));
- } else
- goto invalid_transport;
- }
+ if (transport->lower_transport != GST_RTSP_LOWER_TRANS_TCP) {
+ if (transport->trans == GST_RTSP_TRANS_RTP && transport->port.min >= 0) {
+ if (transport->port.min < 65536 && transport->port.max < 65536) {
+ g_ptr_array_add (strs, g_strdup (";port="));
+ g_ptr_array_add (strs, range_as_text (&transport->port));
+ } else
+ goto invalid_transport;
+ }
- /* add the client_port parameter */
- if (transport->trans == GST_RTSP_TRANS_RTP && transport->client_port.min >= 0) {
- if (transport->client_port.min < 65536 &&
- transport->client_port.max < 65536) {
- g_ptr_array_add (strs, g_strdup (";client_port="));
- g_ptr_array_add (strs, range_as_text (&transport->client_port));
- } else
- goto invalid_transport;
- }
+ /* add the client_port parameter */
+ if (transport->trans == GST_RTSP_TRANS_RTP
+ && transport->client_port.min >= 0) {
+ if (transport->client_port.min < 65536
+ && transport->client_port.max < 65536) {
+ g_ptr_array_add (strs, g_strdup (";client_port="));
+ g_ptr_array_add (strs, range_as_text (&transport->client_port));
+ } else
+ goto invalid_transport;
+ }
- /* add the server_port parameter */
- if (transport->trans == GST_RTSP_TRANS_RTP && transport->server_port.min >= 0) {
- if (transport->server_port.min < 65536 &&
- transport->server_port.max < 65536) {
- g_ptr_array_add (strs, g_strdup (";server_port="));
- g_ptr_array_add (strs, range_as_text (&transport->server_port));
- } else
- goto invalid_transport;
+ /* add the server_port parameter */
+ if (transport->trans == GST_RTSP_TRANS_RTP
+ && transport->server_port.min >= 0) {
+ if (transport->server_port.min < 65536
+ && transport->server_port.max < 65536) {
+ g_ptr_array_add (strs, g_strdup (";server_port="));
+ g_ptr_array_add (strs, range_as_text (&transport->server_port));
+ } else
+ goto invalid_transport;
+ }
}
/* add the ssrc parameter */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtsptransport.h
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtsptransport.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtsptransport.h Wed Mar 24 18:04:17 2010 -0500
@@ -81,6 +81,7 @@
* @GST_RTSP_LOWER_TRANS_UDP: stream data over UDP
* @GST_RTSP_LOWER_TRANS_UDP_MCAST: stream data over UDP multicast
* @GST_RTSP_LOWER_TRANS_TCP: stream data over TCP
+ * @GST_RTSP_LOWER_TRANS_HTTP: stream data tunneled over HTTP. Since: 0.10.23
*
* The different transport methods.
*/
@@ -88,7 +89,8 @@
GST_RTSP_LOWER_TRANS_UNKNOWN = 0,
GST_RTSP_LOWER_TRANS_UDP = (1 << 0),
GST_RTSP_LOWER_TRANS_UDP_MCAST = (1 << 1),
- GST_RTSP_LOWER_TRANS_TCP = (1 << 2)
+ GST_RTSP_LOWER_TRANS_TCP = (1 << 2),
+ GST_RTSP_LOWER_TRANS_HTTP = (1 << 4)
} GstRTSPLowerTrans;
/**
@@ -106,11 +108,25 @@
/**
* GstRTSPTransport:
+ * @trans: the transport mode
+ * @profile: the tansport profile
+ * @lower_transport: the lower transport
+ * @destination: the destination ip/hostname
+ * @source: the source ip/hostname
+ * @layers: the number of layers
+ * @mode_play: if play mode was selected
+ * @mode_record: if record mode was selected
+ * @append: is append mode was selected
+ * @interleaved: the interleave range
+ * @ttl: the time to live for multicast UDP
+ * @port: the port pair for multicast sessions
+ * @client_port: the client port pair for receiving data
+ * @server_port: the server port pair for receiving data
+ * @ssrc: the ssrc that the sender/receiver will use
*
* A structure holding the RTSP transport values.
*/
typedef struct _GstRTSPTransport {
- /*< private >*/
GstRTSPTransMode trans;
GstRTSPProfile profile;
GstRTSPLowerTrans lower_transport;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspurl.c
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspurl.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspurl.c Wed Mar 24 18:04:17 2010 -0500
@@ -58,14 +58,44 @@
#include "gstrtspurl.h"
-#define RTSP_PROTO "rtsp://"
-#define RTSP_PROTO_LEN 7
-#define RTSPU_PROTO "rtspu://"
-#define RTSPU_PROTO_LEN 8
-#define RTSPT_PROTO "rtspt://"
-#define RTSPT_PROTO_LEN 8
+static void
+register_rtsp_url_type (GType * id)
+{
+ *id = g_boxed_type_register_static ("GstRTSPUrl",
+ (GBoxedCopyFunc) gst_rtsp_url_copy, (GBoxedFreeFunc) gst_rtsp_url_free);
+}
+
+GType
+gst_rtsp_url_get_type (void)
+{
+ static GType id;
+ static GOnce once = G_ONCE_INIT;
+
+ g_once (&once, (GThreadFunc) register_rtsp_url_type, &id);
+ return id;
+}
-/* format is rtsp[u]://[user:passwd@]host[:port]/abspath[?query] */
+static const gchar *rtsp_url_schemes[] = {
+ "rtsp",
+ "rtspu",
+ "rtspt",
+ "rtsph",
+ NULL
+};
+
+static GstRTSPLowerTrans rtsp_url_transports[] = {
+ GST_RTSP_LOWER_TRANS_TCP | GST_RTSP_LOWER_TRANS_UDP |
+ GST_RTSP_LOWER_TRANS_UDP_MCAST,
+ GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST,
+ GST_RTSP_LOWER_TRANS_TCP,
+ GST_RTSP_LOWER_TRANS_HTTP | GST_RTSP_LOWER_TRANS_TCP,
+};
+
+/* format is rtsp[u]://[user:passwd@]host[:port]/abspath[?query] where host
+ * is a host name, an IPv4 dotted decimal address ("aaa.bbb.ccc.ddd") or an
+ * [IPv6] address ("[aabb:ccdd:eeff:gghh::sstt]" note the brackets around the
+ * address to allow the distinction between ':' as an IPv6 hexgroup separator
+ * and as a host/port separator) */
/**
* gst_rtsp_url_parse:
@@ -82,6 +112,8 @@
{
GstRTSPUrl *res;
gchar *p, *delim, *at, *col;
+ gchar *host_end = NULL;
+ guint scheme;
g_return_val_if_fail (urlstr != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (url != NULL, GST_RTSP_EINVAL);
@@ -89,18 +121,20 @@
res = g_new0 (GstRTSPUrl, 1);
p = (gchar *) urlstr;
- if (g_str_has_prefix (p, RTSP_PROTO)) {
- res->transports =
- GST_RTSP_LOWER_TRANS_TCP | GST_RTSP_LOWER_TRANS_UDP |
- GST_RTSP_LOWER_TRANS_UDP_MCAST;
- p += RTSP_PROTO_LEN;
- } else if (g_str_has_prefix (p, RTSPU_PROTO)) {
- res->transports = GST_RTSP_LOWER_TRANS_UDP | GST_RTSP_LOWER_TRANS_UDP_MCAST;
- p += RTSPU_PROTO_LEN;
- } else if (g_str_has_prefix (p, RTSPT_PROTO)) {
- res->transports = GST_RTSP_LOWER_TRANS_TCP;
- p += RTSPT_PROTO_LEN;
- } else
+
+ col = strstr (p, "://");
+ if (col == NULL)
+ goto invalid;
+
+ for (scheme = 0; rtsp_url_schemes[scheme] != NULL; scheme++) {
+ if (g_ascii_strncasecmp (rtsp_url_schemes[scheme], p, col - p) == 0) {
+ res->transports = rtsp_url_transports[scheme];
+ p = col + 3;
+ break;
+ }
+ }
+
+ if (res->transports == GST_RTSP_LOWER_TRANS_UNKNOWN)
goto invalid;
delim = strpbrk (p, "/?");
@@ -124,39 +158,52 @@
p = at + 1;
}
- col = strchr (p, ':');
- /* we have a ':' and a delimiter but the ':' is after the delimiter, it's
- * not really part of the hostname */
- if (col && delim && col >= delim)
- col = NULL;
+ if (*p == '[') {
+ res->family = GST_RTSP_FAM_INET6;
+
+ /* we have an IPv6 address in the URL, find the ending ] which must be
+ * before any delimiter */
+ host_end = strchr (++p, ']');
+ if (!host_end || (delim && host_end >= delim))
+ goto invalid;
+
+ /* a port specifier must follow the address immediately */
+ col = host_end[1] == ':' ? host_end + 1 : NULL;
+ } else {
+ res->family = GST_RTSP_FAM_INET;
+
+ col = strchr (p, ':');
- if (col) {
- res->host = g_strndup (p, col - p);
- p = col + 1;
- res->port = strtoul (p, (char **) &p, 10);
- if (delim)
- p = delim;
- } else {
- /* no port specified, set to 0. _get_port() will return the default port. */
- res->port = 0;
- if (!delim) {
- res->host = g_strdup (p);
- p = NULL;
+ /* we have a ':' and a delimiter but the ':' is after the delimiter, it's
+ * not really part of the hostname */
+ if (col && delim && col >= delim)
+ col = NULL;
+
+ host_end = col ? col : delim;
+ }
+
+ if (!host_end)
+ res->host = g_strdup (p);
+ else {
+ res->host = g_strndup (p, host_end - p);
+
+ if (col) {
+ res->port = strtoul (col + 1, NULL, 10);
} else {
- res->host = g_strndup (p, delim - p);
- p = delim;
+ /* no port specified, set to 0. gst_rtsp_url_get_port() will return the
+ * default port */
+ res->port = 0;
}
}
+ p = delim;
if (p && *p == '/') {
delim = strchr (p, '?');
- if (!delim) {
+ if (!delim)
res->abspath = g_strdup (p);
- p = NULL;
- } else {
+ else
res->abspath = g_strndup (p, delim - p);
- p = delim;
- }
+ p = delim;
} else {
res->abspath = g_strdup ("/");
}
@@ -177,6 +224,37 @@
}
/**
+ * gst_rtsp_url_copy:
+ * @url: a #GstRTSPUrl
+ *
+ * Make a copy of @url.
+ *
+ * Returns: a copy of @url. Free with gst_rtsp_url_free () after usage.
+ *
+ * Since: 0.10.22
+ */
+GstRTSPUrl *
+gst_rtsp_url_copy (const GstRTSPUrl * url)
+{
+ GstRTSPUrl *res;
+
+ g_return_val_if_fail (url != NULL, NULL);
+
+ res = g_new0 (GstRTSPUrl, 1);
+
+ res->transports = url->transports;
+ res->family = url->family;
+ res->user = g_strdup (url->user);
+ res->passwd = g_strdup (url->passwd);
+ res->host = g_strdup (url->host);
+ res->port = url->port;
+ res->abspath = g_strdup (url->abspath);
+ res->query = g_strdup (url->query);
+
+ return res;
+}
+
+/**
* gst_rtsp_url_free:
* @url: a #GstRTSPUrl
*
@@ -225,7 +303,7 @@
* Returns: #GST_RTSP_OK.
*/
GstRTSPResult
-gst_rtsp_url_get_port (GstRTSPUrl * url, guint16 * port)
+gst_rtsp_url_get_port (const GstRTSPUrl * url, guint16 * port)
{
g_return_val_if_fail (url != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (port != NULL, GST_RTSP_EINVAL);
@@ -248,18 +326,27 @@
* Returns: a string with the request URI. g_free() after usage.
*/
gchar *
-gst_rtsp_url_get_request_uri (GstRTSPUrl * url)
+gst_rtsp_url_get_request_uri (const GstRTSPUrl * url)
{
gchar *uri;
+ gchar *pre_host;
+ gchar *post_host;
+ gchar *pre_query;
+ gchar *query;
g_return_val_if_fail (url != NULL, NULL);
+ pre_host = url->family == GST_RTSP_FAM_INET6 ? "[" : "";
+ post_host = url->family == GST_RTSP_FAM_INET6 ? "]" : "";
+ pre_query = url->query ? "?" : "";
+ query = url->query ? url->query : "";
+
if (url->port != 0) {
- uri = g_strdup_printf ("rtsp://%s:%u%s%s%s", url->host, url->port,
- url->abspath, url->query ? "?" : "", url->query ? url->query : "");
+ uri = g_strdup_printf ("rtsp://%s%s%s:%u%s%s%s", pre_host, url->host,
+ post_host, url->port, url->abspath, pre_query, query);
} else {
- uri = g_strdup_printf ("rtsp://%s%s%s%s", url->host, url->abspath,
- url->query ? "?" : "", url->query ? url->query : "");
+ uri = g_strdup_printf ("rtsp://%s%s%s%s%s%s", pre_host, url->host,
+ post_host, url->abspath, pre_query, query);
}
return uri;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/gstrtspurl.h
--- a/gst_plugins_base/gst-libs/gst/rtsp/gstrtspurl.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/rtsp/gstrtspurl.h Wed Mar 24 18:04:17 2010 -0500
@@ -44,6 +44,7 @@
#define __GST_RTSP_URL_H__
#include
+#include
#include
#include
@@ -57,6 +58,8 @@
*/
#define GST_RTSP_DEFAULT_PORT 554
+#define GST_TYPE_RTSP_URL (gst_rtsp_url_get_type())
+
typedef struct _GstRTSPUrl GstRTSPUrl;
/**
@@ -83,12 +86,15 @@
gchar *query;
};
+GType gst_rtsp_url_get_type (void);
+
GstRTSPResult gst_rtsp_url_parse (const gchar *urlstr, GstRTSPUrl **url);
+GstRTSPUrl* gst_rtsp_url_copy (const GstRTSPUrl *url);
void gst_rtsp_url_free (GstRTSPUrl *url);
-gchar* gst_rtsp_url_get_request_uri (GstRTSPUrl *url);
+gchar* gst_rtsp_url_get_request_uri (const GstRTSPUrl *url);
GstRTSPResult gst_rtsp_url_set_port (GstRTSPUrl *url, guint16 port);
-GstRTSPResult gst_rtsp_url_get_port (GstRTSPUrl *url, guint16 *port);
+GstRTSPResult gst_rtsp_url_get_port (const GstRTSPUrl *url, guint16 *port);
G_END_DECLS
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/md5.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/rtsp/md5.c Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,271 @@
+/*
+ * This code implements the MD5 message-digest algorithm.
+ * The algorithm is due to Ron Rivest. This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ *
+ * To compute the message digest of a chunk of bytes, declare an
+ * MD5Context structure, pass it to MD5Init, call MD5Update as
+ * needed on buffers full of bytes, and then call MD5Final, which
+ * will fill a supplied 16-byte array with the digest.
+ */
+
+/* Brutally hacked by John Walker back from ANSI C to K&R (no
+ prototypes) to maintain the tradition that Netfone will compile
+ with Sun's original "cc". */
+
+#include /* for memcpy() */
+#include
+#include "md5.h"
+
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+#define HIGHFIRST
+#endif
+
+#ifndef HIGHFIRST
+#define byteReverse(buf, len) /* Nothing */
+#else
+/*
+ * Note: this code is harmless on little-endian machines.
+ */
+void
+byteReverse (buf, longs)
+ unsigned char *buf;
+ unsigned longs;
+{
+ uint32 t;
+
+ do {
+ t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+ ((unsigned) buf[1] << 8 | buf[0]);
+ *(uint32 *) buf = t;
+ buf += 4;
+ } while (--longs);
+}
+#endif
+
+/*
+ * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
+ * initialization constants.
+ */
+void
+MD5Init (ctx)
+ struct MD5Context *ctx;
+{
+ ctx->buf[0] = 0x67452301;
+ ctx->buf[1] = 0xefcdab89;
+ ctx->buf[2] = 0x98badcfe;
+ ctx->buf[3] = 0x10325476;
+
+ ctx->bits[0] = 0;
+ ctx->bits[1] = 0;
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void
+MD5Update (ctx, buf, len)
+ struct MD5Context *ctx;
+ const char *buf;
+ unsigned len;
+{
+ uint32 t;
+
+ /* Update bitcount */
+
+ t = ctx->bits[0];
+ if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
+ ctx->bits[1]++; /* Carry from low to high */
+ ctx->bits[1] += len >> 29;
+
+ t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
+
+ /* Handle any leading odd-sized chunks */
+
+ if (t) {
+ unsigned char *p = (unsigned char *) ctx->in + t;
+
+ t = 64 - t;
+ if (len < t) {
+ memcpy (p, buf, len);
+ return;
+ }
+ memcpy (p, buf, t);
+ byteReverse (ctx->in, 16);
+ MD5Transform (ctx->buf, (uint32 *) ctx->in);
+ buf += t;
+ len -= t;
+ }
+ /* Process data in 64-byte chunks */
+
+ while (len >= 64) {
+ memcpy (ctx->in, buf, 64);
+ byteReverse (ctx->in, 16);
+ MD5Transform (ctx->buf, (uint32 *) ctx->in);
+ buf += 64;
+ len -= 64;
+ }
+
+ /* Handle any remaining bytes of data. */
+
+ memcpy (ctx->in, buf, len);
+}
+
+/*
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * 1 0* (64-bit count of bits processed, MSB-first)
+ */
+void
+MD5Final (digest, ctx)
+ unsigned char digest[16];
+ struct MD5Context *ctx;
+{
+ unsigned count;
+ unsigned char *p;
+
+ /* Compute number of bytes mod 64 */
+ count = (ctx->bits[0] >> 3) & 0x3F;
+
+ /* Set the first char of padding to 0x80. This is safe since there is
+ always at least one byte free */
+ p = ctx->in + count;
+ *p++ = 0x80;
+
+ /* Bytes of padding needed to make 64 bytes */
+ count = 64 - 1 - count;
+
+ /* Pad out to 56 mod 64 */
+ if (count < 8) {
+ /* Two lots of padding: Pad the first block to 64 bytes */
+ memset (p, 0, count);
+ byteReverse (ctx->in, 16);
+ MD5Transform (ctx->buf, (uint32 *) ctx->in);
+
+ /* Now fill the next block with 56 bytes */
+ memset (ctx->in, 0, 56);
+ } else {
+ /* Pad block to 56 bytes */
+ memset (p, 0, count - 8);
+ }
+ byteReverse (ctx->in, 14);
+
+ /* Append length in bits and transform */
+ ((uint32 *) ctx->in)[14] = ctx->bits[0];
+ ((uint32 *) ctx->in)[15] = ctx->bits[1];
+
+ MD5Transform (ctx->buf, (uint32 *) ctx->in);
+ byteReverse ((unsigned char *) ctx->buf, 4);
+ memcpy (digest, ctx->buf, 16);
+ memset (ctx, 0, sizeof (ctx)); /* In case it's sensitive */
+}
+
+
+/* The four core functions - F1 is optimized somewhat */
+
+/* #define F1(x, y, z) (x & y | ~x & z) */
+#define F1(x, y, z) (z ^ (x & (y ^ z)))
+#define F2(x, y, z) F1(z, x, y)
+#define F3(x, y, z) (x ^ y ^ z)
+#define F4(x, y, z) (y ^ (x | ~z))
+
+/* This is the central step in the MD5 algorithm. */
+#define MD5STEP(f, w, x, y, z, data, s) \
+ ( w += f(x, y, z) + data, w = w<>(32-s), w += x )
+
+/*
+ * The core of the MD5 algorithm, this alters an existing MD5 hash to
+ * reflect the addition of 16 longwords of new data. MD5Update blocks
+ * the data and converts bytes into longwords for this routine.
+ */
+void
+MD5Transform (buf, in)
+ uint32 buf[4];
+ uint32 in[16];
+{
+ register uint32 a, b, c, d;
+
+ a = buf[0];
+ b = buf[1];
+ c = buf[2];
+ d = buf[3];
+
+ MD5STEP (F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+ MD5STEP (F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+ MD5STEP (F1, c, d, a, b, in[2] + 0x242070db, 17);
+ MD5STEP (F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+ MD5STEP (F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+ MD5STEP (F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+ MD5STEP (F1, c, d, a, b, in[6] + 0xa8304613, 17);
+ MD5STEP (F1, b, c, d, a, in[7] + 0xfd469501, 22);
+ MD5STEP (F1, a, b, c, d, in[8] + 0x698098d8, 7);
+ MD5STEP (F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+ MD5STEP (F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+ MD5STEP (F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+ MD5STEP (F1, a, b, c, d, in[12] + 0x6b901122, 7);
+ MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12);
+ MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17);
+ MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+ MD5STEP (F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+ MD5STEP (F2, d, a, b, c, in[6] + 0xc040b340, 9);
+ MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+ MD5STEP (F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+ MD5STEP (F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+ MD5STEP (F2, d, a, b, c, in[10] + 0x02441453, 9);
+ MD5STEP (F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+ MD5STEP (F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+ MD5STEP (F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+ MD5STEP (F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+ MD5STEP (F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+ MD5STEP (F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+ MD5STEP (F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+ MD5STEP (F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+ MD5STEP (F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+ MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+ MD5STEP (F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+ MD5STEP (F3, d, a, b, c, in[8] + 0x8771f681, 11);
+ MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+ MD5STEP (F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+ MD5STEP (F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+ MD5STEP (F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+ MD5STEP (F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+ MD5STEP (F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+ MD5STEP (F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+ MD5STEP (F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+ MD5STEP (F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+ MD5STEP (F3, b, c, d, a, in[6] + 0x04881d05, 23);
+ MD5STEP (F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+ MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+ MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+ MD5STEP (F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
+
+ MD5STEP (F4, a, b, c, d, in[0] + 0xf4292244, 6);
+ MD5STEP (F4, d, a, b, c, in[7] + 0x432aff97, 10);
+ MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+ MD5STEP (F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+ MD5STEP (F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+ MD5STEP (F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+ MD5STEP (F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+ MD5STEP (F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+ MD5STEP (F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+ MD5STEP (F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+ MD5STEP (F4, c, d, a, b, in[6] + 0xa3014314, 15);
+ MD5STEP (F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+ MD5STEP (F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+ MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+ MD5STEP (F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+ MD5STEP (F4, b, c, d, a, in[9] + 0xeb86d391, 21);
+
+ buf[0] += a;
+ buf[1] += b;
+ buf[2] += c;
+ buf[3] += d;
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/md5.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/rtsp/md5.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,28 @@
+#ifndef MD5_H
+#define MD5_H
+
+#include "_stdint.h"
+
+#ifndef uint32
+typedef uint32_t uint32;
+#endif
+
+struct MD5Context
+{
+ uint32 buf[4];
+ uint32 bits[2];
+ unsigned char in[64];
+};
+
+extern void MD5Init (struct MD5Context *ctx);
+extern void MD5Update (struct MD5Context *ctx, const char *buf,
+ unsigned len);
+extern void MD5Final (unsigned char digest[16], struct MD5Context *ctx);
+extern void MD5Transform (uint32 buf[4], uint32 in[16]);
+
+/*
+ * This is needed to make RSAREF happy on some MS-DOS compilers.
+ */
+typedef struct MD5Context MD5_CTX;
+
+#endif /* !MD5_H */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/rtsp-marshal.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/rtsp/rtsp-marshal.c Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,91 @@
+#include "rtsp-marshal.h"
+
+#include
+
+
+#ifdef G_ENABLE_DEBUG
+#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
+#define g_marshal_value_peek_char(v) g_value_get_char (v)
+#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
+#define g_marshal_value_peek_int(v) g_value_get_int (v)
+#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
+#define g_marshal_value_peek_long(v) g_value_get_long (v)
+#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
+#define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
+#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
+#define g_marshal_value_peek_enum(v) g_value_get_enum (v)
+#define g_marshal_value_peek_flags(v) g_value_get_flags (v)
+#define g_marshal_value_peek_float(v) g_value_get_float (v)
+#define g_marshal_value_peek_double(v) g_value_get_double (v)
+#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
+#define g_marshal_value_peek_param(v) g_value_get_param (v)
+#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
+#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
+#define g_marshal_value_peek_object(v) g_value_get_object (v)
+#else /* !G_ENABLE_DEBUG */
+/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
+ * Do not access GValues directly in your code. Instead, use the
+ * g_value_get_*() functions
+ */
+#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
+#define g_marshal_value_peek_char(v) (v)->data[0].v_int
+#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_int(v) (v)->data[0].v_int
+#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_long(v) (v)->data[0].v_long
+#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
+#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
+#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
+#define g_marshal_value_peek_enum(v) (v)->data[0].v_long
+#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong
+#define g_marshal_value_peek_float(v) (v)->data[0].v_float
+#define g_marshal_value_peek_double(v) (v)->data[0].v_double
+#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
+#endif /* !G_ENABLE_DEBUG */
+
+
+/* ENUM:POINTER,POINTER (rtsp-marshal.list:1) */
+void
+gst_rtsp_marshal_ENUM__POINTER_POINTER (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef gint (*GMarshalFunc_ENUM__POINTER_POINTER) (gpointer data1,
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer data2);
+ register GMarshalFunc_ENUM__POINTER_POINTER callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+ gint v_return;
+
+ g_return_if_fail (return_value != NULL);
+ g_return_if_fail (n_param_values == 3);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_ENUM__POINTER_POINTER) (marshal_data ? marshal_data : cc->callback);
+
+ v_return = callback (data1,
+ g_marshal_value_peek_pointer (param_values + 1),
+ g_marshal_value_peek_pointer (param_values + 2),
+ data2);
+
+ g_value_set_enum (return_value, v_return);
+}
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/rtsp/rtsp-marshal.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/rtsp/rtsp-marshal.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,20 @@
+
+#ifndef __gst_rtsp_marshal_MARSHAL_H__
+#define __gst_rtsp_marshal_MARSHAL_H__
+
+#include
+
+G_BEGIN_DECLS
+
+/* ENUM:POINTER,POINTER (rtsp-marshal.list:1) */
+extern void gst_rtsp_marshal_ENUM__POINTER_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+
+G_END_DECLS
+
+#endif /* __gst_rtsp_marshal_MARSHAL_H__ */
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/sdp/gstsdpmessage.c
--- a/gst_plugins_base/gst-libs/gst/sdp/gstsdpmessage.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/sdp/gstsdpmessage.c Wed Mar 24 18:04:17 2010 -0500
@@ -69,6 +69,11 @@
#include /* For GST_STR_NULL */
#ifdef G_OS_WIN32
+/* ws2_32.dll has getaddrinfo and freeaddrinfo on Windows XP and later.
+ * minwg32 headers check WINVER before allowing the use of these */
+#ifndef WINVER
+#define WINVER 0x0501
+#endif
#ifdef _MSC_VER
#include
#endif
@@ -151,10 +156,6 @@
g_array_append_val (msg->field, v); \
return GST_SDP_OK; \
}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
static void
gst_sdp_origin_init (GstSDPOrigin * origin)
@@ -328,14 +329,13 @@
struct addrinfo *ai;
struct addrinfo *res;
gboolean ret = FALSE;
- int err;
memset (&hints, 0, sizeof (hints));
hints.ai_socktype = SOCK_DGRAM;
g_return_val_if_fail (host_name, FALSE);
- if ((err = getaddrinfo (host_name, NULL, &hints, &res)) < 0)
+ if (getaddrinfo (host_name, NULL, &hints, &res) < 0)
return FALSE;
for (ai = res; !ret && ai; ai = ai->ai_next) {
@@ -1742,17 +1742,38 @@
gst_sdp_message_add_phone (c->msg, buffer);
break;
case 'c':
- READ_STRING (c->msg->connection.nettype);
- READ_STRING (c->msg->connection.addrtype);
- READ_STRING (c->msg->connection.address);
- READ_UINT (c->msg->connection.ttl);
- READ_UINT (c->msg->connection.addr_number);
+ {
+ GstSDPConnection conn;
+ gchar *str2;
+
+ memset (&conn, 0, sizeof (conn));
+
+ str2 = p;
+ while ((str2 = strchr (str2, '/')))
+ *str2++ = ' ';
+ READ_STRING (conn.nettype);
+ READ_STRING (conn.addrtype);
+ READ_STRING (conn.address);
+ READ_UINT (conn.ttl);
+ READ_UINT (conn.addr_number);
+
+ if (c->state == SDP_SESSION) {
+ gst_sdp_message_set_connection (c->msg, conn.nettype, conn.addrtype,
+ conn.address, conn.ttl, conn.addr_number);
+ } else {
+ gst_sdp_media_add_connection (c->media, conn.nettype, conn.addrtype,
+ conn.address, conn.ttl, conn.addr_number);
+ }
+ gst_sdp_connection_init (&conn);
break;
+ }
case 'b':
{
gchar str2[MAX_LINE_LEN];
read_string_del (str, sizeof (str), ':', &p);
+ if (*p != '\0')
+ p++;
read_string (str2, sizeof (str2), &p);
if (c->state == SDP_SESSION)
gst_sdp_message_add_bandwidth (c->msg, str, atoi (str2));
@@ -1875,10 +1896,10 @@
static void
print_media (GstSDPMedia * media)
{
- g_print (" media: '%s'\n", media->media);
+ g_print (" media: '%s'\n", GST_STR_NULL (media->media));
g_print (" port: '%u'\n", media->port);
g_print (" num_ports: '%u'\n", media->num_ports);
- g_print (" proto: '%s'\n", media->proto);
+ g_print (" proto: '%s'\n", GST_STR_NULL (media->proto));
if (media->fmts->len > 0) {
guint i;
@@ -1887,10 +1908,37 @@
g_print (" format '%s'\n", g_array_index (media->fmts, gchar *, i));
}
}
- g_print (" information: '%s'\n", media->information);
+ g_print (" information: '%s'\n", GST_STR_NULL (media->information));
+ if (media->connections->len > 0) {
+ guint i;
+
+ g_print (" connections:\n");
+ for (i = 0; i < media->connections->len; i++) {
+ GstSDPConnection *conn =
+ &g_array_index (media->connections, GstSDPConnection, i);
+
+ g_print (" nettype: '%s'\n", GST_STR_NULL (conn->nettype));
+ g_print (" addrtype: '%s'\n", GST_STR_NULL (conn->addrtype));
+ g_print (" address: '%s'\n", GST_STR_NULL (conn->address));
+ g_print (" ttl: '%u'\n", conn->ttl);
+ g_print (" addr_number: '%u'\n", conn->addr_number);
+ }
+ }
+ if (media->bandwidths->len > 0) {
+ guint i;
+
+ g_print (" bandwidths:\n");
+ for (i = 0; i < media->bandwidths->len; i++) {
+ GstSDPBandwidth *bw =
+ &g_array_index (media->bandwidths, GstSDPBandwidth, i);
+
+ g_print (" type: '%s'\n", GST_STR_NULL (bw->bwtype));
+ g_print (" bandwidth: '%u'\n", bw->bandwidth);
+ }
+ }
g_print (" key:\n");
- g_print (" type: '%s'\n", media->key.type);
- g_print (" data: '%s'\n", media->key.data);
+ g_print (" type: '%s'\n", GST_STR_NULL (media->key.type));
+ g_print (" data: '%s'\n", GST_STR_NULL (media->key.data));
if (media->attributes->len > 0) {
guint i;
@@ -1952,6 +2000,18 @@
g_print (" address: '%s'\n", GST_STR_NULL (msg->connection.address));
g_print (" ttl: '%u'\n", msg->connection.ttl);
g_print (" addr_number: '%u'\n", msg->connection.addr_number);
+ if (msg->bandwidths->len > 0) {
+ guint i;
+
+ g_print (" bandwidths:\n");
+ for (i = 0; i < msg->bandwidths->len; i++) {
+ GstSDPBandwidth *bw =
+ &g_array_index (msg->bandwidths, GstSDPBandwidth, i);
+
+ g_print (" type: '%s'\n", GST_STR_NULL (bw->bwtype));
+ g_print (" bandwidth: '%u'\n", bw->bandwidth);
+ }
+ }
g_print (" key:\n");
g_print (" type: '%s'\n", GST_STR_NULL (msg->key.type));
g_print (" data: '%s'\n", GST_STR_NULL (msg->key.data));
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/tag/gstid3tag.c
--- a/gst_plugins_base/gst-libs/gst/tag/gstid3tag.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/tag/gstid3tag.c Wed Mar 24 18:04:17 2010 -0500
@@ -398,7 +398,7 @@
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_DATE, date, NULL);
g_date_free (date);
}
- if (data[125] == 0) {
+ if (data[125] == 0 && data[126] != 0) {
gst_tag_extract_id3v1_string (list, GST_TAG_COMMENT, (gchar *) & data[97],
28);
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_TRACK_NUMBER,
@@ -407,7 +407,7 @@
gst_tag_extract_id3v1_string (list, GST_TAG_COMMENT, (gchar *) & data[97],
30);
}
- if (data[127] < gst_tag_id3_genre_count ()) {
+ if (data[127] < gst_tag_id3_genre_count () && !gst_tag_list_is_empty (list)) {
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_GENRE,
gst_tag_id3_genre_get (data[127]), NULL);
}
@@ -452,3 +452,62 @@
return NULL;
return genres[id];
}
+
+/**
+ * gst_tag_list_add_id3_image:
+ * @tag_list: a tag list
+ * @image_data: the (encoded) image
+ * @image_data_len: the length of the encoded image data at @image_data
+ * @id3_picture_type: picture type as per the ID3 (v2.4.0) specification for
+ * the APIC frame (0 = unknown/other)
+ *
+ * Adds an image from an ID3 APIC frame (or similar, such as used in FLAC)
+ * to the given tag list. Also see gst_tag_image_data_to_image_buffer() for
+ * more information on image tags in GStreamer.
+ *
+ * Returns: %TRUE if the image was processed, otherwise %FALSE
+ *
+ * Since: 0.10.20
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_tag_list_add_id3_image (GstTagList * tag_list, const guint8 * image_data,
+ guint image_data_len, guint id3_picture_type)
+{
+ GstTagImageType tag_image_type;
+ const gchar *tag_name;
+ GstBuffer *image;
+
+ g_return_val_if_fail (GST_IS_TAG_LIST (tag_list), FALSE);
+ g_return_val_if_fail (image_data != NULL, FALSE);
+ g_return_val_if_fail (image_data_len > 0, FALSE);
+
+ if (id3_picture_type == 0x01 || id3_picture_type == 0x02) {
+ /* file icon for preview. Don't add image-type to caps, since there
+ * is only supposed to be one of these, and the type is already indicated
+ * via the special tag */
+ tag_name = GST_TAG_PREVIEW_IMAGE;
+ tag_image_type = GST_TAG_IMAGE_TYPE_NONE;
+ } else {
+ tag_name = GST_TAG_IMAGE;
+
+ /* Remap the ID3v2 APIC type our ImageType enum */
+ if (id3_picture_type >= 0x3 && id3_picture_type <= 0x14)
+ tag_image_type = (GstTagImageType) (id3_picture_type - 2);
+ else
+ tag_image_type = GST_TAG_IMAGE_TYPE_UNDEFINED;
+ }
+
+ image = gst_tag_image_data_to_image_buffer (image_data, image_data_len,
+ tag_image_type);
+
+ if (image == NULL)
+ return FALSE;
+
+ gst_tag_list_add (tag_list, GST_TAG_MERGE_APPEND, tag_name, image, NULL);
+ gst_buffer_unref (image);
+ return TRUE;
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/tag/gsttagdemux.c
--- a/gst_plugins_base/gst-libs/gst/tag/gsttagdemux.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/tag/gsttagdemux.c Wed Mar 24 18:04:17 2010 -0500
@@ -75,11 +75,7 @@
#include "gsttagdemux.h"
#include
-#ifndef __SYMBIAN32__
#include
-#else
-#include "gst/gst-i18n-plugin.h"
-#endif
#include
typedef enum
@@ -115,6 +111,8 @@
GstSegment segment;
gboolean need_newseg;
gboolean newseg_update;
+
+ GList *pending_events;
};
/* Require at least 8kB of data before we attempt typefind.
@@ -166,6 +164,27 @@
static void gst_tag_demux_init (GstTagDemux * obj, GstTagDemuxClass * klass);
static gpointer parent_class; /* NULL */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+
+GType
+gst_tag_demux_result_get_type (void)
+{
+ static GType etype = 0;
+ if (etype == 0) {
+ static const GEnumValue values[] = {
+ {GST_TAG_DEMUX_RESULT_BROKEN_TAG, "GST_TAG_DEMUX_RESULT_BROKEN_TAG",
+ "broken-tag"},
+ {GST_TAG_DEMUX_RESULT_AGAIN, "GST_TAG_DEMUX_RESULT_AGAIN", "again"},
+ {GST_TAG_DEMUX_RESULT_OK, "GST_TAG_DEMUX_RESULT_OK", "ok"},
+ {0, NULL, NULL}
+ };
+ etype = g_enum_register_static ("GstTagDemuxResult", values);
+ }
+ return etype;
+}
/* Cannot use boilerplate macros here because we want the abstract flag */
#ifdef __SYMBIAN32__
@@ -258,6 +277,11 @@
gst_segment_init (&tagdemux->priv->segment, GST_FORMAT_UNDEFINED);
tagdemux->priv->need_newseg = TRUE;
tagdemux->priv->newseg_update = FALSE;
+
+ g_list_foreach (tagdemux->priv->pending_events,
+ (GFunc) gst_mini_object_unref, NULL);
+ g_list_free (tagdemux->priv->pending_events);
+ tagdemux->priv->pending_events = NULL;
}
static void
@@ -423,8 +447,6 @@
need_sub = TRUE;
}
- g_assert (out_size > 0);
-
if (need_sub == TRUE) {
if (out_size != GST_BUFFER_SIZE (buf) || !gst_buffer_is_writable (buf)) {
GstBuffer *sub;
@@ -656,6 +678,8 @@
return GST_FLOW_UNEXPECTED;
}
if (outbuf) {
+ GList *events;
+
if (G_UNLIKELY (demux->priv->srcpad == NULL)) {
gst_buffer_unref (outbuf);
return GST_FLOW_ERROR;
@@ -670,7 +694,20 @@
demux->priv->need_newseg = FALSE;
}
- /* Send pending tag event */
+ /* send any pending events we cached */
+ GST_OBJECT_LOCK (demux);
+ events = demux->priv->pending_events;
+ demux->priv->pending_events = NULL;
+ GST_OBJECT_UNLOCK (demux);
+
+ while (events != NULL) {
+ GST_DEBUG_OBJECT (demux->priv->srcpad, "sending cached %s event: %"
+ GST_PTR_FORMAT, GST_EVENT_TYPE_NAME (events->data), events->data);
+ gst_pad_push_event (demux->priv->srcpad, GST_EVENT (events->data));
+ events = g_list_delete_link (events, events);
+ }
+
+ /* Send our own pending tag event */
if (demux->priv->send_tag_event) {
gst_tag_demux_send_tag_event (demux);
demux->priv->send_tag_event = FALSE;
@@ -728,7 +765,18 @@
break;
}
default:
- ret = gst_pad_event_default (pad, event);
+ if (demux->priv->need_newseg) {
+ /* Cache all events if we have a pending segment, so they don't get
+ * lost (esp. tag events) */
+ GST_INFO_OBJECT (demux, "caching event: %" GST_PTR_FORMAT, event);
+ GST_OBJECT_LOCK (demux);
+ demux->priv->pending_events =
+ g_list_append (demux->priv->pending_events, event);
+ GST_OBJECT_UNLOCK (demux);
+ ret = TRUE;
+ } else {
+ ret = gst_pad_event_default (pad, event);
+ }
break;
}
@@ -829,12 +877,14 @@
break;
}
default:
- /* FIXME: shouldn't we pass unknown and unhandled events upstream? */
+ res = gst_pad_push_event (tagdemux->priv->sinkpad, event);
+ event = NULL;
break;
}
gst_object_unref (tagdemux);
- gst_event_unref (event);
+ if (event)
+ gst_event_unref (event);
return res;
}
@@ -1159,6 +1209,13 @@
demux->priv->send_tag_event = TRUE;
}
+ if (demux->priv->upstream_size <=
+ demux->priv->strip_start + demux->priv->strip_end) {
+ /* There was no data (probably due to a truncated file) */
+ GST_DEBUG_OBJECT (demux, "No data in file");
+ return FALSE;
+ }
+
/* 3 - Do typefinding on data */
caps = gst_type_find_helper_get_range (GST_OBJECT (demux),
(GstTypeFindHelperGetRangeFunction) gst_tag_demux_read_range,
@@ -1269,7 +1326,7 @@
{
GST_DEBUG_OBJECT (demux, "attempted read beyond end of file");
if (*buffer != NULL) {
- gst_buffer_unref (buffer);
+ gst_buffer_unref (*buffer);
*buffer = NULL;
}
return GST_FLOW_UNEXPECTED;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/tag/gsttagdemux.h
--- a/gst_plugins_base/gst-libs/gst/tag/gsttagdemux.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/tag/gsttagdemux.h Wed Mar 24 18:04:17 2010 -0500
@@ -50,9 +50,17 @@
GST_TAG_DEMUX_RESULT_AGAIN,
GST_TAG_DEMUX_RESULT_OK
} GstTagDemuxResult;
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GType gst_tag_demux_result_get_type (void);
+#define GST_TYPE_TAG_DEMUX_RESULT (gst_tag_demux_result_get_type())
/**
* GstTagDemux:
+ * @element: parent element
*
* Opaque #GstTagDemux structure.
*
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/tag/gstvorbistag.c
--- a/gst_plugins_base/gst-libs/gst/tag/gstvorbistag.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/tag/gstvorbistag.c Wed Mar 24 18:04:17 2010 -0500
@@ -62,7 +62,7 @@
{GST_TAG_COPYRIGHT, "COPYRIGHT"},
{GST_TAG_LICENSE, "LICENSE"},
{GST_TAG_LICENSE_URI, "LICENSE"},
- {GST_TAG_LOCATION, "LOCATION"},
+ {GST_TAG_GEO_LOCATION_NAME, "LOCATION"},
{GST_TAG_ORGANIZATION, "ORGANIZATION"},
{GST_TAG_DESCRIPTION, "DESCRIPTION"},
{GST_TAG_GENRE, "GENRE"},
@@ -90,7 +90,10 @@
{GST_TAG_LANGUAGE_CODE, "LANGUAGE"},
{GST_TAG_CDDA_MUSICBRAINZ_DISCID, "MUSICBRAINZ_DISCID"},
{GST_TAG_CDDA_CDDB_DISCID, "DISCID"},
- /* some incidence that this makes sense:
+ /* For the apparent de-facto standard for coverart in vorbis comments, see:
+ * http://www.hydrogenaudio.org/forums/lofiversion/index.php/t48386.html */
+ {GST_TAG_PREVIEW_IMAGE, "COVERART"},
+ /* some evidence that "BPM" is used elsewhere:
* http://mail.kde.org/pipermail/amarok/2006-May/000090.html
*/
{GST_TAG_BEATS_PER_MINUTE, "BPM"},
@@ -317,6 +320,62 @@
}
}
+static void
+gst_vorbis_tag_add_coverart (GstTagList * tags, gchar * img_data_base64,
+ gint base64_len)
+{
+ GstBuffer *img;
+ gsize img_len;
+ guchar *out;
+ guint save = 0;
+ gint state = 0;
+
+ if (base64_len < 2)
+ goto not_enough_data;
+
+ /* img_data_base64 points to a temporary copy of the base64 encoded data, so
+ * it's safe to do inpace decoding here
+ * TODO: glib 2.20 and later provides g_base64_decode_inplace, so change this
+ * to use glib's API instead once it's in wider use:
+ * http://bugzilla.gnome.org/show_bug.cgi?id=564728
+ * http://svn.gnome.org/viewvc/glib?view=revision&revision=7807 */
+ out = (guchar *) img_data_base64;
+ img_len = g_base64_decode_step (img_data_base64, base64_len,
+ out, &state, &save);
+
+ if (img_len == 0)
+ goto decode_failed;
+
+ img = gst_tag_image_data_to_image_buffer (out, img_len,
+ GST_TAG_IMAGE_TYPE_NONE);
+
+ if (img == NULL)
+ goto convert_failed;
+
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
+ GST_TAG_PREVIEW_IMAGE, img, NULL);
+
+ gst_buffer_unref (img);
+ return;
+
+/* ERRORS */
+not_enough_data:
+ {
+ GST_WARNING ("COVERART tag with too little base64-encoded data");
+ return;
+ }
+decode_failed:
+ {
+ GST_WARNING ("Couldn't decode base64 image data from COVERART tag");
+ return;
+ }
+convert_failed:
+ {
+ GST_WARNING ("Couldn't extract image or image type from COVERART tag");
+ return;
+ }
+}
+
/**
* gst_tag_list_from_vorbiscomment_buffer:
* @buffer: buffer to convert
@@ -353,7 +412,7 @@
guint cur_size;
guint iterations;
guint8 *data;
- guint size;
+ guint size, value_len;
GstTagList *list;
g_return_val_if_fail (GST_IS_BUFFER (buffer), NULL);
@@ -365,14 +424,19 @@
if (size < 11 || size <= id_data_length + 4)
goto error;
+
if (id_data_length > 0 && memcmp (data, id_data, id_data_length) != 0)
goto error;
+
ADVANCE (id_data_length);
+
if (vendor_string)
*vendor_string = g_strndup (cur, cur_size);
+
ADVANCE (cur_size);
iterations = cur_size;
cur_size = 0;
+
while (iterations) {
ADVANCE (cur_size);
iterations--;
@@ -384,11 +448,19 @@
}
*value = '\0';
value++;
- if (!g_utf8_validate (value, -1, NULL)) {
+ value_len = strlen (value);
+ if (value_len == 0 || !g_utf8_validate (value, value_len, NULL)) {
g_free (cur);
continue;
}
- gst_vorbis_tag_add (list, cur, value);
+ /* we'll just ignore COVERARTMIME and typefind the image data */
+ if (g_ascii_strcasecmp (cur, "COVERARTMIME") == 0) {
+ continue;
+ } else if (g_ascii_strcasecmp (cur, "COVERART") == 0) {
+ gst_vorbis_tag_add_coverart (list, value, value_len);
+ } else {
+ gst_vorbis_tag_add (list, cur, value);
+ }
g_free (cur);
}
@@ -399,6 +471,7 @@
return NULL;
#undef ADVANCE
}
+
typedef struct
{
guint count;
@@ -407,6 +480,39 @@
}
MyForEach;
+static GList *
+gst_tag_to_coverart (const GValue * image_value)
+{
+ gchar *coverart_data, *data_result, *mime_result;
+ const gchar *mime_type;
+ GstStructure *mime_struct;
+ GstBuffer *buffer;
+ GList *l = NULL;
+
+ g_return_val_if_fail (image_value != NULL, NULL);
+
+ buffer = gst_value_get_buffer (image_value);
+ g_return_val_if_fail (gst_caps_is_fixed (buffer->caps), NULL);
+ mime_struct = gst_caps_get_structure (buffer->caps, 0);
+ mime_type = gst_structure_get_name (mime_struct);
+
+ if (strcmp (mime_type, "text/uri-list") == 0) {
+ /* URI reference */
+ coverart_data = g_strndup ((gchar *) buffer->data, buffer->size);
+ } else {
+ coverart_data = g_base64_encode (buffer->data, buffer->size);
+ }
+
+ data_result = g_strdup_printf ("COVERART=%s", coverart_data);
+ mime_result = g_strdup_printf ("COVERARTMIME=%s", mime_type);
+ g_free (coverart_data);
+
+ l = g_list_append (l, data_result);
+ l = g_list_append (l, mime_result);
+
+ return l;
+}
+
/**
* gst_tag_to_vorbis_comments:
* @list: a #GstTagList
@@ -432,6 +538,18 @@
g_return_val_if_fail (list != NULL, NULL);
g_return_val_if_fail (tag != NULL, NULL);
+ /* Special case: cover art is split into two tags to store data and
+ * MIME-type. Even if the tag list contains multiple entries, there is
+ * no reasonable way to save more than one.
+ * If both, preview image and image, are present we prefer the
+ * image tag.
+ */
+ if ((strcmp (tag, GST_TAG_PREVIEW_IMAGE) == 0 &&
+ gst_tag_list_get_tag_size (list, GST_TAG_IMAGE) == 0) ||
+ strcmp (tag, GST_TAG_IMAGE) == 0) {
+ return gst_tag_to_coverart (gst_tag_list_get_value_index (list, tag, 0));
+ }
+
if (strcmp (tag, GST_TAG_EXTENDED_COMMENT) != 0) {
vorbis_tag = gst_tag_to_vorbis_tag (tag);
if (!vorbis_tag)
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/tag/tag.h
--- a/gst_plugins_base/gst-libs/gst/tag/tag.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/tag/tag.h Wed Mar 24 18:04:17 2010 -0500
@@ -126,6 +126,9 @@
/**
* GstTagImageType:
+ * @GST_TAG_IMAGE_TYPE_NONE : No image type. Can be used to
+ * tell functions such as gst_tag_image_data_to_image_buffer() that no
+ * image type should be set. (Since: 0.10.20)
* @GST_TAG_IMAGE_TYPE_UNDEFINED : Undefined/other image type
* @GST_TAG_IMAGE_TYPE_FRONT_COVER : Cover (front)
* @GST_TAG_IMAGE_TYPE_BACK_COVER : Cover (back)
@@ -151,8 +154,10 @@
*
* Since: 0.10.9
*/
+/* Note: keep in sync with register_tag_image_type_enum() */
typedef enum {
- GST_TAG_IMAGE_TYPE_UNDEFINED,
+ GST_TAG_IMAGE_TYPE_NONE = -1,
+ GST_TAG_IMAGE_TYPE_UNDEFINED = 0,
GST_TAG_IMAGE_TYPE_FRONT_COVER,
GST_TAG_IMAGE_TYPE_BACK_COVER,
GST_TAG_IMAGE_TYPE_LEAFLET_PAGE,
@@ -256,6 +261,15 @@
#endif
G_CONST_RETURN gchar * gst_tag_to_id3_tag (const gchar * gst_tag);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+gboolean gst_tag_list_add_id3_image (GstTagList * tag_list,
+ const guint8 * image_data,
+ guint image_data_len,
+ guint id3_picture_type);
/* other tag-related functions */
#ifdef __SYMBIAN32__
@@ -276,6 +290,14 @@
gchar * gst_tag_freeform_string_to_utf8 (const gchar * data,
gint size,
const gchar ** env_vars);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+
+GstBuffer * gst_tag_image_data_to_image_buffer (const guint8 * image_data,
+ guint image_data_len,
+ GstTagImageType image_type);
/* FIXME 0.11: replace with a more general gst_tag_library_init() */
#ifdef __SYMBIAN32__
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/tag/tags.c
--- a/gst_plugins_base/gst-libs/gst/tag/tags.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/tag/tags.c Wed Mar 24 18:04:17 2010 -0500
@@ -1,6 +1,6 @@
/* GStreamer non-core tag registration and tag utility functions
* Copyright (C) 2005 Ross Burton
- * Copyright (C) 2006 Tim-Philipp Müller
+ * Copyright (C) 2006-2008 Tim-Philipp Müller
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -22,11 +22,8 @@
#include "config.h"
#endif
-#ifndef __SYMBIAN32__
#include
-#else
-#include "gst/gst-i18n-plugin.h"
-#endif
+#include
#include
#include "tag.h"
@@ -54,6 +51,7 @@
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
/* musicbrainz tags */
@@ -114,6 +112,7 @@
register_tag_image_type_enum (GType * id)
{
static const GEnumValue image_types[] = {
+ {GST_TAG_IMAGE_TYPE_NONE, "GST_TAG_IMAGE_TYPE_NONE", "none"},
{GST_TAG_IMAGE_TYPE_UNDEFINED, "GST_TAG_IMAGE_TYPE_UNDEFINED", "undefined"},
{GST_TAG_IMAGE_TYPE_FRONT_COVER, "GST_TAG_IMAGE_TYPE_FRONT_COVER",
"front-cover"},
@@ -152,6 +151,9 @@
};
*id = g_enum_register_static ("GstTagImageType", image_types);
+
+ /* work around thread-safety issue with class creation in GLib */
+ g_type_class_ref (*id);
}
#ifdef __SYMBIAN32__
EXPORT_C
@@ -162,12 +164,27 @@
gst_tag_image_type_get_type (void)
{
static GType id;
+
static GOnce once = G_ONCE_INIT;
g_once (&once, (GThreadFunc) register_tag_image_type_enum, &id);
return id;
}
+static inline gboolean
+gst_tag_image_type_is_valid (GstTagImageType type)
+{
+ GEnumClass *klass;
+
+ gboolean res;
+
+ klass = g_type_class_ref (gst_tag_image_type_get_type ());
+ res = (g_enum_get_value (klass, type) != NULL);
+ g_type_class_unref (klass);
+
+ return res;
+}
+
/**
* gst_tag_parse_extended_comment:
* @ext_comment: an extended comment string, see #GST_TAG_EXTENDED_COMMENT
@@ -264,7 +281,9 @@
const gchar ** env_vars)
{
const gchar *cur_loc = NULL;
+
gsize bytes_read;
+
gchar *utf8 = NULL;
g_return_val_if_fail (data != NULL, NULL);
@@ -346,3 +365,119 @@
g_free (utf8);
return NULL;
}
+
+/**
+ * gst_tag_image_data_to_image_buffer:
+ * @image_data: the (encoded) image
+ * @image_data_len: the length of the encoded image data at @image_data
+ * @image_type: type of the image, or #GST_TAG_IMAGE_TYPE_UNDEFINED. Pass
+ * #GST_TAG_IMAGE_TYPE_NONE if no image type should be set at all (e.g.
+ * for preview images)
+ *
+ * Helper function for tag-reading plugins to create a #GstBuffer suitable to
+ * add to a #GstTagList as an image tag (such as #GST_TAG_IMAGE or
+ * #GST_TAG_PREVIEW_IMAGE) from the encoded image data and an (optional) image
+ * type.
+ *
+ * Background: cover art and other images in tags are usually stored as a
+ * blob of binary image data, often accompanied by a MIME type or some other
+ * content type string (e.g. 'png', 'jpeg', 'jpg'). Sometimes there is also an
+ * 'image type' to indicate what kind of image this is (e.g. front cover,
+ * back cover, artist, etc.). The image data may also be an URI to the image
+ * rather than the image itself.
+ *
+ * In GStreamer, image tags are #GstBuffers containing the raw image
+ * data, with the buffer caps describing the content type of the image
+ * (e.g. image/jpeg, image/png, text/uri-list). The buffer caps may contain
+ * an additional 'image-type' field of #GST_TYPE_TAG_IMAGE_TYPE to describe
+ * the type of image (front cover, back cover etc.). #GST_TAG_PREVIEW_IMAGE
+ * tags should not carry an image type, their type is already indicated via
+ * the special tag name.
+ *
+ * This function will do various checks and typefind the encoded image
+ * data (we can't trust the declared mime type).
+ *
+ * Returns: a newly-allocated image buffer for use in tag lists, or NULL
+ *
+ * Since: 0.10.20
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstBuffer *
+gst_tag_image_data_to_image_buffer (const guint8 * image_data,
+ guint image_data_len, GstTagImageType image_type)
+{
+ const gchar *name;
+
+ GstBuffer *image;
+
+ GstCaps *caps;
+
+ g_return_val_if_fail (image_data != NULL, NULL);
+ g_return_val_if_fail (image_data_len > 0, NULL);
+ g_return_val_if_fail (gst_tag_image_type_is_valid (image_type), NULL);
+
+ GST_DEBUG ("image data len: %u bytes", image_data_len);
+
+ /* allocate space for a NUL terminator for an uri too */
+ image = gst_buffer_try_new_and_alloc (image_data_len + 1);
+ if (image == NULL) {
+ GST_WARNING ("failed to allocate buffer of %d for image", image_data_len);
+ return NULL;
+ }
+
+ memcpy (GST_BUFFER_DATA (image), image_data, image_data_len);
+ GST_BUFFER_DATA (image)[image_data_len] = '\0';
+
+ /* Find GStreamer media type, can't trust declared type */
+ caps = gst_type_find_helper_for_buffer (NULL, image, NULL);
+
+ if (caps == NULL)
+ goto no_type;
+
+ GST_DEBUG ("Found GStreamer media type: %" GST_PTR_FORMAT, caps);
+
+ /* sanity check: make sure typefound/declared caps are either URI or image */
+ name = gst_structure_get_name (gst_caps_get_structure (caps, 0));
+
+ if (!g_str_has_prefix (name, "image/") &&
+ !g_str_has_prefix (name, "video/") &&
+ !g_str_equal (name, "text/uri-list")) {
+ GST_DEBUG ("Unexpected image type '%s', ignoring image frame", name);
+ goto error;
+ }
+
+ /* Decrease size by 1 if we don't have an URI list
+ * to keep the original size of the image
+ */
+ if (!g_str_equal (name, "text/uri-list"))
+ GST_BUFFER_SIZE (image) = image_data_len;
+
+ if (image_type != GST_TAG_IMAGE_TYPE_NONE) {
+ GST_LOG ("Setting image type: %d", image_type);
+ caps = gst_caps_make_writable (caps);
+ gst_caps_set_simple (caps, "image-type", GST_TYPE_TAG_IMAGE_TYPE,
+ image_type, NULL);
+ }
+
+ gst_buffer_set_caps (image, caps);
+ gst_caps_unref (caps);
+ return image;
+
+/* ERRORS */
+no_type:
+ {
+ GST_DEBUG ("Could not determine GStreamer media type, ignoring image");
+ /* fall through */
+ }
+error:
+ {
+ if (image)
+ gst_buffer_unref (image);
+ if (caps)
+ gst_caps_unref (caps);
+ return NULL;
+ }
+}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/video/gstvideofilter.c
--- a/gst_plugins_base/gst-libs/gst/video/gstvideofilter.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/video/gstvideofilter.c Wed Mar 24 18:04:17 2010 -0500
@@ -39,6 +39,8 @@
#include "gstvideofilter.h"
+#include
+
GST_DEBUG_CATEGORY_STATIC (gst_video_filter_debug);
#define GST_CAT_DEFAULT gst_video_filter_debug
@@ -75,6 +77,26 @@
return video_filter_type;
}
+static gboolean
+gst_video_filter_get_unit_size (GstBaseTransform * btrans, GstCaps * caps,
+ guint * size)
+{
+ GstVideoFormat fmt;
+ gint width, height;
+
+ if (!gst_video_format_parse_caps (caps, &fmt, &width, &height)) {
+ GST_WARNING_OBJECT (btrans, "Failed to parse caps %" GST_PTR_FORMAT, caps);
+ return FALSE;
+ }
+
+ *size = gst_video_format_get_size (fmt, width, height);
+
+ GST_DEBUG_OBJECT (btrans, "Returning size %u bytes for caps %"
+ GST_PTR_FORMAT, *size, caps);
+
+ return TRUE;
+}
+
static void
gst_video_filter_class_init (gpointer g_class, gpointer class_data)
{
@@ -88,6 +110,9 @@
gstelement_class = (GstElementClass *) klass;
trans_class = (GstBaseTransformClass *) klass;
+ trans_class->get_unit_size =
+ GST_DEBUG_FUNCPTR (gst_video_filter_get_unit_size);
+
parent_class = g_type_class_peek_parent (klass);
GST_DEBUG_CATEGORY_INIT (gst_video_filter_debug, "videofilter", 0,
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/video/video-enumtypes.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/video/video-enumtypes.c Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,50 @@
+
+/* Generated data (by glib-mkenums) */
+
+#include "video-enumtypes.h"
+
+#include "video.h"
+
+/* enumerations from "video.h" */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GType
+gst_video_format_get_type (void)
+{
+ static volatile gsize g_define_type_id__volatile = 0;
+ if (g_once_init_enter (&g_define_type_id__volatile)) {
+ static const GEnumValue values[] = {
+ { GST_VIDEO_FORMAT_UNKNOWN, "GST_VIDEO_FORMAT_UNKNOWN", "unknown" },
+ { GST_VIDEO_FORMAT_I420, "GST_VIDEO_FORMAT_I420", "i420" },
+ { GST_VIDEO_FORMAT_YV12, "GST_VIDEO_FORMAT_YV12", "yv12" },
+ { GST_VIDEO_FORMAT_YUY2, "GST_VIDEO_FORMAT_YUY2", "yuy2" },
+ { GST_VIDEO_FORMAT_UYVY, "GST_VIDEO_FORMAT_UYVY", "uyvy" },
+ { GST_VIDEO_FORMAT_AYUV, "GST_VIDEO_FORMAT_AYUV", "ayuv" },
+ { GST_VIDEO_FORMAT_RGBx, "GST_VIDEO_FORMAT_RGBx", "rgbx" },
+ { GST_VIDEO_FORMAT_BGRx, "GST_VIDEO_FORMAT_BGRx", "bgrx" },
+ { GST_VIDEO_FORMAT_xRGB, "GST_VIDEO_FORMAT_xRGB", "xrgb" },
+ { GST_VIDEO_FORMAT_xBGR, "GST_VIDEO_FORMAT_xBGR", "xbgr" },
+ { GST_VIDEO_FORMAT_RGBA, "GST_VIDEO_FORMAT_RGBA", "rgba" },
+ { GST_VIDEO_FORMAT_BGRA, "GST_VIDEO_FORMAT_BGRA", "bgra" },
+ { GST_VIDEO_FORMAT_ARGB, "GST_VIDEO_FORMAT_ARGB", "argb" },
+ { GST_VIDEO_FORMAT_ABGR, "GST_VIDEO_FORMAT_ABGR", "abgr" },
+ { GST_VIDEO_FORMAT_RGB, "GST_VIDEO_FORMAT_RGB", "rgb" },
+ { GST_VIDEO_FORMAT_BGR, "GST_VIDEO_FORMAT_BGR", "bgr" },
+ { GST_VIDEO_FORMAT_Y41B, "GST_VIDEO_FORMAT_Y41B", "y41b" },
+ { GST_VIDEO_FORMAT_Y42B, "GST_VIDEO_FORMAT_Y42B", "y42b" },
+ { GST_VIDEO_FORMAT_YVYU, "GST_VIDEO_FORMAT_YVYU", "yvyu" },
+ { GST_VIDEO_FORMAT_Y444, "GST_VIDEO_FORMAT_Y444", "y444" },
+ { GST_VIDEO_FORMAT_v210, "GST_VIDEO_FORMAT_v210", "v210" },
+ { GST_VIDEO_FORMAT_v216, "GST_VIDEO_FORMAT_v216", "v216" },
+ { 0, NULL, NULL }
+ };
+ GType g_define_type_id = g_enum_register_static ("GstVideoFormat", values);
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
+ }
+ return g_define_type_id__volatile;
+}
+
+/* Generated data ends here */
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/video/video-enumtypes.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst-libs/gst/video/video-enumtypes.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,23 @@
+
+/* Generated data (by glib-mkenums) */
+
+#ifndef __GST_VIDEO_ENUM_TYPES_H__
+#define __GST_VIDEO_ENUM_TYPES_H__
+
+#include
+
+G_BEGIN_DECLS
+
+/* enumerations from "video.h" */
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
+GType gst_video_format_get_type (void);
+#define GST_TYPE_VIDEO_FORMAT (gst_video_format_get_type())
+G_END_DECLS
+
+#endif /* __GST_VIDEO_ENUM_TYPES_H__ */
+
+/* Generated data ends here */
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/video/video.c
--- a/gst_plugins_base/gst-libs/gst/video/video.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/video/video.c Wed Mar 24 18:04:17 2010 -0500
@@ -45,7 +45,19 @@
int green_mask, int blue_mask);
-/* This is simply a convenience function, nothing more or less */
+/**
+ * gst_video_frame_rate:
+ * @pad: pointer to a #GstPad
+ *
+ * A convenience function to retrieve a GValue holding the framerate
+ * from the caps on a pad.
+ *
+ * The pad needs to have negotiated caps containing a framerate property.
+ *
+ * Returns: NULL if the pad has no configured caps or the configured caps
+ * do not contain a framerate.
+ *
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
@@ -87,11 +99,25 @@
return fps;
}
+
+/**
+ * gst_video_get_size:
+ * @pad: pointer to a #GstPad
+ * @width: pointer to integer to hold pixel width of the video frames (output)
+ * @height: pointer to integer to hold pixel height of the video frames (output)
+ *
+ * Inspect the caps of the provided pad and retrieve the width and height of
+ * the video frames it is configured for.
+ *
+ * The pad needs to have negotiated caps containing width and height properties.
+ *
+ * Returns: TRUE if the width and height could be retrieved.
+ *
+ */
#ifdef __SYMBIAN32__
EXPORT_C
#endif
-
gboolean
gst_video_get_size (GstPad * pad, gint * width, gint * height)
{
@@ -206,11 +232,45 @@
}
/**
+ * gst_video_format_parse_caps_interlaced:
+ * @caps: the fixed #GstCaps to parse
+ * @interlaced: whether @caps represents interlaced video or not, may be NULL (output)
+ *
+ * Extracts whether the caps represents interlaced content or not and places it
+ * in @interlaced.
+ *
+ * Since: 0.10.23
+ *
+ * Returns: TRUE if @caps was parsed correctly.
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+gboolean
+gst_video_format_parse_caps_interlaced (GstCaps * caps, gboolean * interlaced)
+{
+ GstStructure *structure;
+
+ if (!gst_caps_is_fixed (caps))
+ return FALSE;
+
+ structure = gst_caps_get_structure (caps, 0);
+
+ if (interlaced) {
+ if (!gst_structure_get_boolean (structure, "interlaced", interlaced))
+ *interlaced = FALSE;
+ }
+
+ return TRUE;
+}
+
+/**
* gst_video_format_parse_caps:
* @caps: the #GstCaps to parse
* @format: the #GstVideoFormat of the video represented by @caps (output)
- * @width: the width of the video represented by @caps (output)
- * @height: the height of the video represented by @caps (output)
+ * @width: the width of the video represented by @caps, may be NULL (output)
+ * @height: the height of the video represented by @caps, may be NULL (output)
*
* Determines the #GstVideoFormat of @caps and places it in the location
* pointed to by @format. Extracts the size of the video and places it
@@ -304,11 +364,12 @@
return ok;
}
+
/**
* gst_video_parse_caps_framerate:
- * @caps:
- * @fps_n: pointer to numerator of frame rate (output)
- * @fps_d: pointer to denominator of frame rate (output)
+ * @caps: pointer to a #GstCaps instance
+ * @fps_n: pointer to integer to hold numerator of frame rate (output)
+ * @fps_d: pointer to integer to hold denominator of frame rate (output)
*
* Extracts the frame rate from @caps and places the values in the locations
* pointed to by @fps_n and @fps_d. Returns TRUE if the values could be
@@ -340,7 +401,7 @@
/**
* gst_video_parse_caps_pixel_aspect_ratio:
- * @caps:
+ * @caps: pointer to a #GstCaps instance
* @par_n: pointer to numerator of pixel aspect ratio (output)
* @par_d: pointer to denominator of pixel aspect ratio (output)
*
@@ -378,6 +439,43 @@
}
/**
+ * gst_video_format_new_caps_interlaced:
+ * @format: the #GstVideoFormat describing the raw video format
+ * @width: width of video
+ * @height: height of video
+ * @framerate_n: numerator of frame rate
+ * @framerate_d: denominator of frame rate
+ * @par_n: numerator of pixel aspect ratio
+ * @par_d: denominator of pixel aspect ratio
+ * @interlaced: #TRUE if the format is interlaced
+ *
+ * Creates a new #GstCaps object based on the parameters provided.
+ *
+ * Since: 0.10.23
+ *
+ * Returns: a new #GstCaps object, or NULL if there was an error
+ */
+#ifdef __SYMBIAN32__
+EXPORT_C
+#endif
+
+GstCaps *
+gst_video_format_new_caps_interlaced (GstVideoFormat format, int width,
+ int height, int framerate_n, int framerate_d, int par_n, int par_d,
+ gboolean interlaced)
+{
+ GstCaps *res;
+
+ res =
+ gst_video_format_new_caps (format, width, height, framerate_n,
+ framerate_d, par_n, par_d);
+ if (interlaced && (res != NULL))
+ gst_caps_set_simple (res, "interlaced", G_TYPE_BOOLEAN, TRUE, NULL);
+
+ return res;
+}
+
+/**
* gst_video_format_new_caps:
* @format: the #GstVideoFormat describing the raw video format
* @width: width of video
@@ -401,6 +499,9 @@
gst_video_format_new_caps (GstVideoFormat format, int width, int height,
int framerate_n, int framerate_d, int par_n, int par_d)
{
+ g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, NULL);
+ g_return_val_if_fail (width > 0 && height > 0, NULL);
+
if (gst_video_format_is_yuv (format)) {
return gst_caps_new_simple ("video/x-raw-yuv",
"format", GST_TYPE_FOURCC, gst_video_format_to_fourcc (format),
@@ -509,6 +610,8 @@
return GST_VIDEO_FORMAT_YV12;
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
return GST_VIDEO_FORMAT_YUY2;
+ case GST_MAKE_FOURCC ('Y', 'V', 'Y', 'U'):
+ return GST_VIDEO_FORMAT_YVYU;
case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
return GST_VIDEO_FORMAT_UYVY;
case GST_MAKE_FOURCC ('A', 'Y', 'U', 'V'):
@@ -517,6 +620,12 @@
return GST_VIDEO_FORMAT_Y41B;
case GST_MAKE_FOURCC ('Y', '4', '2', 'B'):
return GST_VIDEO_FORMAT_Y42B;
+ case GST_MAKE_FOURCC ('Y', '4', '4', '4'):
+ return GST_VIDEO_FORMAT_Y444;
+ case GST_MAKE_FOURCC ('v', '2', '1', '0'):
+ return GST_VIDEO_FORMAT_v210;
+ case GST_MAKE_FOURCC ('v', '2', '1', '6'):
+ return GST_VIDEO_FORMAT_v216;
default:
return GST_VIDEO_FORMAT_UNKNOWN;
}
@@ -541,6 +650,8 @@
guint32
gst_video_format_to_fourcc (GstVideoFormat format)
{
+ g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, 0);
+
switch (format) {
case GST_VIDEO_FORMAT_I420:
return GST_MAKE_FOURCC ('I', '4', '2', '0');
@@ -548,6 +659,8 @@
return GST_MAKE_FOURCC ('Y', 'V', '1', '2');
case GST_VIDEO_FORMAT_YUY2:
return GST_MAKE_FOURCC ('Y', 'U', 'Y', '2');
+ case GST_VIDEO_FORMAT_YVYU:
+ return GST_MAKE_FOURCC ('Y', 'V', 'Y', 'U');
case GST_VIDEO_FORMAT_UYVY:
return GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y');
case GST_VIDEO_FORMAT_AYUV:
@@ -556,12 +669,18 @@
return GST_MAKE_FOURCC ('Y', '4', '1', 'B');
case GST_VIDEO_FORMAT_Y42B:
return GST_MAKE_FOURCC ('Y', '4', '2', 'B');
+ case GST_VIDEO_FORMAT_Y444:
+ return GST_MAKE_FOURCC ('Y', '4', '4', '4');
+ case GST_VIDEO_FORMAT_v210:
+ return GST_MAKE_FOURCC ('v', '2', '1', '0');
+ case GST_VIDEO_FORMAT_v216:
+ return GST_MAKE_FOURCC ('v', '2', '1', '6');
default:
return 0;
}
}
-/**
+/*
* gst_video_format_from_rgb32_masks:
* @red_mask: red bit mask
* @green_mask: green bit mask
@@ -638,6 +757,8 @@
* gst_video_format_is_rgb:
* @format: a #GstVideoFormat
*
+ * Determine whether the video format is an RGB format.
+ *
* Since: 0.10.16
*
* Returns: TRUE if @format represents RGB video
@@ -653,10 +774,14 @@
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_YUY2:
+ case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
case GST_VIDEO_FORMAT_AYUV:
case GST_VIDEO_FORMAT_Y41B:
case GST_VIDEO_FORMAT_Y42B:
+ case GST_VIDEO_FORMAT_Y444:
+ case GST_VIDEO_FORMAT_v210:
+ case GST_VIDEO_FORMAT_v216:
return FALSE;
case GST_VIDEO_FORMAT_RGBx:
case GST_VIDEO_FORMAT_BGRx:
@@ -678,6 +803,8 @@
* gst_video_format_is_yuv:
* @format: a #GstVideoFormat
*
+ * Determine whether the video format is a YUV format.
+ *
* Since: 0.10.16
*
* Returns: TRUE if @format represents YUV video
@@ -693,10 +820,14 @@
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_YUY2:
+ case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
case GST_VIDEO_FORMAT_AYUV:
case GST_VIDEO_FORMAT_Y41B:
case GST_VIDEO_FORMAT_Y42B:
+ case GST_VIDEO_FORMAT_Y444:
+ case GST_VIDEO_FORMAT_v210:
+ case GST_VIDEO_FORMAT_v216:
return TRUE;
case GST_VIDEO_FORMAT_RGBx:
case GST_VIDEO_FORMAT_BGRx:
@@ -717,6 +848,9 @@
/**
* gst_video_format_has_alpha:
* @format: a #GstVideoFormat
+ *
+ * Returns TRUE or FALSE depending on if the video format provides an
+ * alpha channel.
*
* Since: 0.10.16
*
@@ -733,9 +867,13 @@
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_YUY2:
+ case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
case GST_VIDEO_FORMAT_Y41B:
case GST_VIDEO_FORMAT_Y42B:
+ case GST_VIDEO_FORMAT_Y444:
+ case GST_VIDEO_FORMAT_v210:
+ case GST_VIDEO_FORMAT_v216:
return FALSE;
case GST_VIDEO_FORMAT_AYUV:
case GST_VIDEO_FORMAT_RGBA:
@@ -781,6 +919,10 @@
gst_video_format_get_row_stride (GstVideoFormat format, int component,
int width)
{
+ g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, 0);
+ g_return_val_if_fail (component >= 0 && component <= 3, 0);
+ g_return_val_if_fail (width > 0, 0);
+
switch (format) {
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
@@ -790,6 +932,7 @@
return GST_ROUND_UP_4 (GST_ROUND_UP_2 (width) / 2);
}
case GST_VIDEO_FORMAT_YUY2:
+ case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
return GST_ROUND_UP_4 (width * 2);
case GST_VIDEO_FORMAT_AYUV:
@@ -817,6 +960,12 @@
} else {
return GST_ROUND_UP_8 (width) / 2;
}
+ case GST_VIDEO_FORMAT_Y444:
+ return GST_ROUND_UP_4 (width);
+ case GST_VIDEO_FORMAT_v210:
+ return ((width + 47) / 48) * 128;
+ case GST_VIDEO_FORMAT_v216:
+ return GST_ROUND_UP_8 (width * 4);
default:
return 0;
}
@@ -843,13 +992,18 @@
int
gst_video_format_get_pixel_stride (GstVideoFormat format, int component)
{
+ g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, 0);
+ g_return_val_if_fail (component >= 0 && component <= 3, 0);
+
switch (format) {
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_Y41B:
case GST_VIDEO_FORMAT_Y42B:
+ case GST_VIDEO_FORMAT_Y444:
return 1;
case GST_VIDEO_FORMAT_YUY2:
+ case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
if (component == 0) {
return 2;
@@ -869,6 +1023,15 @@
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR:
return 3;
+ case GST_VIDEO_FORMAT_v210:
+ /* v210 is packed at the bit level, so pixel stride doesn't make sense */
+ return 0;
+ case GST_VIDEO_FORMAT_v216:
+ if (component == 0) {
+ return 4;
+ } else {
+ return 8;
+ }
default:
return 0;
}
@@ -896,27 +1059,29 @@
gst_video_format_get_component_width (GstVideoFormat format, int component,
int width)
{
+ g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, 0);
+ g_return_val_if_fail (component >= 0 && component <= 3, 0);
+ g_return_val_if_fail (width > 0, 0);
+
switch (format) {
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_YUY2:
+ case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
+ case GST_VIDEO_FORMAT_Y42B:
+ case GST_VIDEO_FORMAT_v210:
+ case GST_VIDEO_FORMAT_v216:
if (component == 0) {
return width;
} else {
return GST_ROUND_UP_2 (width) / 2;
}
- case GST_VIDEO_FORMAT_Y41B: /* CHECKME: component_width for Y41B */
+ case GST_VIDEO_FORMAT_Y41B:
if (component == 0) {
return width;
} else {
- return GST_ROUND_UP_8 (width) / 4;
- }
- case GST_VIDEO_FORMAT_Y42B: /* CHECKME: component_width for Y42B */
- if (component == 0) {
- return width;
- } else {
- return GST_ROUND_UP_8 (width) / 2;
+ return GST_ROUND_UP_4 (width) / 4;
}
case GST_VIDEO_FORMAT_AYUV:
case GST_VIDEO_FORMAT_RGBx:
@@ -929,6 +1094,7 @@
case GST_VIDEO_FORMAT_ABGR:
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR:
+ case GST_VIDEO_FORMAT_Y444:
return width;
default:
return 0;
@@ -957,6 +1123,10 @@
gst_video_format_get_component_height (GstVideoFormat format, int component,
int height)
{
+ g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, 0);
+ g_return_val_if_fail (component >= 0 && component <= 3, 0);
+ g_return_val_if_fail (height > 0, 0);
+
switch (format) {
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
@@ -968,6 +1138,7 @@
case GST_VIDEO_FORMAT_Y41B:
case GST_VIDEO_FORMAT_Y42B:
case GST_VIDEO_FORMAT_YUY2:
+ case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
case GST_VIDEO_FORMAT_AYUV:
case GST_VIDEO_FORMAT_RGBx:
@@ -980,6 +1151,9 @@
case GST_VIDEO_FORMAT_ABGR:
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR:
+ case GST_VIDEO_FORMAT_Y444:
+ case GST_VIDEO_FORMAT_v210:
+ case GST_VIDEO_FORMAT_v216:
return height;
default:
return 0;
@@ -1012,6 +1186,10 @@
gst_video_format_get_component_offset (GstVideoFormat format, int component,
int width, int height)
{
+ g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, 0);
+ g_return_val_if_fail (component >= 0 && component <= 3, 0);
+ g_return_val_if_fail (width > 0 && height > 0, 0);
+
switch (format) {
case GST_VIDEO_FORMAT_I420:
if (component == 0)
@@ -1043,6 +1221,14 @@
if (component == 2)
return 3;
return 0;
+ case GST_VIDEO_FORMAT_YVYU:
+ if (component == 0)
+ return 0;
+ if (component == 1)
+ return 3;
+ if (component == 2)
+ return 1;
+ return 0;
case GST_VIDEO_FORMAT_UYVY:
if (component == 0)
return 1;
@@ -1137,6 +1323,19 @@
if (component == 2)
return (GST_ROUND_UP_4 (width) + (GST_ROUND_UP_8 (width) / 2)) * height;
return 0;
+ case GST_VIDEO_FORMAT_Y444:
+ return GST_ROUND_UP_4 (width) * height * component;
+ case GST_VIDEO_FORMAT_v210:
+ /* v210 is bit-packed, so this doesn't make sense */
+ return 0;
+ case GST_VIDEO_FORMAT_v216:
+ if (component == 0)
+ return 0;
+ if (component == 1)
+ return 2;
+ if (component == 2)
+ return 6;
+ return 0;
default:
return 0;
}
@@ -1164,6 +1363,9 @@
{
int size;
+ g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, 0);
+ g_return_val_if_fail (width > 0 && height > 0, 0);
+
switch (format) {
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
@@ -1172,6 +1374,7 @@
(GST_ROUND_UP_2 (height) / 2) * 2;
return size;
case GST_VIDEO_FORMAT_YUY2:
+ case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
return GST_ROUND_UP_4 (width * 2) * height;
case GST_VIDEO_FORMAT_AYUV:
@@ -1193,6 +1396,12 @@
case GST_VIDEO_FORMAT_Y42B:
/* simplification of ROUNDUP4(w)*h + 2*(ROUNDUP8(w)/2)*h: */
return (GST_ROUND_UP_4 (width) + GST_ROUND_UP_8 (width)) * height;
+ case GST_VIDEO_FORMAT_Y444:
+ return GST_ROUND_UP_4 (width) * height * 3;
+ case GST_VIDEO_FORMAT_v210:
+ return ((width + 47) / 48) * 128 * height;
+ case GST_VIDEO_FORMAT_v216:
+ return GST_ROUND_UP_8 (width * 4) * height;
default:
return 0;
}
@@ -1232,6 +1441,9 @@
gboolean ret = FALSE;
int size;
+ g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, 0);
+ g_return_val_if_fail (width > 0 && height > 0, 0);
+
size = gst_video_format_get_size (format, width, height);
GST_DEBUG ("converting value %" G_GINT64_FORMAT " from %s to %s",
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst-libs/gst/video/video.h
--- a/gst_plugins_base/gst-libs/gst/video/video.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst-libs/gst/video/video.h Wed Mar 24 18:04:17 2010 -0500
@@ -25,26 +25,32 @@
G_BEGIN_DECLS
+#include
+
/**
* GstVideoFormat:
- * @GST_VIDEO_FORMAT_UNKNOWN,
+ * @GST_VIDEO_FORMAT_UNKNOWN: Unknown or unset video format id
* @GST_VIDEO_FORMAT_I420: planar 4:2:0 YUV
* @GST_VIDEO_FORMAT_YV12: planar 4:2:0 YVU (like I420 but UV planes swapped)
* @GST_VIDEO_FORMAT_YUY2: packed 4:2:2 YUV (Y0-U0-Y1-V0 Y2-U2-Y3-V2 Y4 ...)
* @GST_VIDEO_FORMAT_UYVY: packed 4:2:2 YUV (U0-Y0-V0-Y1 U2-Y2-V2-Y3 U4 ...)
* @GST_VIDEO_FORMAT_AYUV: packed 4:4:4 YUV with alpha channel (A0-Y0-U0-V0 ...)
- * @GST_VIDEO_FORMAT_RGBx:
- * @GST_VIDEO_FORMAT_BGRx:
- * @GST_VIDEO_FORMAT_xRGB:
- * @GST_VIDEO_FORMAT_xBGR:
- * @GST_VIDEO_FORMAT_RGBA:
- * @GST_VIDEO_FORMAT_BGRA:
- * @GST_VIDEO_FORMAT_ARGB:
- * @GST_VIDEO_FORMAT_ABGR:
- * @GST_VIDEO_FORMAT_RGB:
- * @GST_VIDEO_FORMAT_BGR:
+ * @GST_VIDEO_FORMAT_RGBx: sparse rgb packed into 32 bit, space last
+ * @GST_VIDEO_FORMAT_BGRx: sparse reverse rgb packed into 32 bit, space last
+ * @GST_VIDEO_FORMAT_xRGB: sparse rgb packed into 32 bit, space first
+ * @GST_VIDEO_FORMAT_xBGR: sparse reverse rgb packed into 32 bit, space first
+ * @GST_VIDEO_FORMAT_RGBA: rgb with alpha channel last
+ * @GST_VIDEO_FORMAT_BGRA: reverse rgb with alpha channel last
+ * @GST_VIDEO_FORMAT_ARGB: rgb with alpha channel first
+ * @GST_VIDEO_FORMAT_ABGR: reverse rgb with alpha channel first
+ * @GST_VIDEO_FORMAT_RGB: rgb
+ * @GST_VIDEO_FORMAT_BGR: reverse rgb
* @GST_VIDEO_FORMAT_Y41B: planar 4:1:1 YUV (Since: 0.10.18)
* @GST_VIDEO_FORMAT_Y42B: planar 4:2:2 YUV (Since: 0.10.18)
+ * @GST_VIDEO_FORMAT_YVYU: packed 4:2:2 YUV (Y0-V0-Y1-U0 Y2-V2-Y3-U2 Y4 ...) (Since: 0.10.23)
+ * @GST_VIDEO_FORMAT_Y444: planar 4:4:4 YUV (Since: 0.10.24)
+ * @GST_VIDEO_FORMAT_v210: packed 4:2:2 10-bit YUV, complex format (Since: 0.10.24)
+ * @GST_VIDEO_FORMAT_v216: packed 4:2:2 16-bit YUV, Y0-U0-Y1-V1 order (Since: 0.10.24)
*
* Enum value describing the most common video formats.
*/
@@ -66,7 +72,11 @@
GST_VIDEO_FORMAT_RGB,
GST_VIDEO_FORMAT_BGR,
GST_VIDEO_FORMAT_Y41B,
- GST_VIDEO_FORMAT_Y42B
+ GST_VIDEO_FORMAT_Y42B,
+ GST_VIDEO_FORMAT_YVYU,
+ GST_VIDEO_FORMAT_Y444,
+ GST_VIDEO_FORMAT_v210,
+ GST_VIDEO_FORMAT_v216
} GstVideoFormat;
#define GST_VIDEO_BYTE1_MASK_32 "0xFF000000"
@@ -227,6 +237,38 @@
"height = " GST_VIDEO_SIZE_RANGE ", " \
"framerate = " GST_VIDEO_FPS_RANGE
+/* buffer flags */
+
+/**
+ * GST_VIDEO_BUFFER_TFF:
+ *
+ * If the #GstBuffer is interlaced, then the first field in the video frame is
+ * the top field. If unset, the bottom field is first.
+ *
+ * Since: 0.10.23
+ */
+#define GST_VIDEO_BUFFER_TFF GST_BUFFER_FLAG_MEDIA1
+
+/**
+ * GST_VIDEO_BUFFER_RFF:
+ *
+ * If the #GstBuffer is interlaced, then the first field (as defined by the
+ * %GST_VIDEO_BUFFER_TFF flag setting) is repeated.
+ *
+ * Since: 0.10.23
+ */
+#define GST_VIDEO_BUFFER_RFF GST_BUFFER_FLAG_MEDIA2
+
+/**
+ * GST_VIDEO_BUFFER_ONEFIELD:
+ *
+ * If the #GstBuffer is interlaced, then only the first field (as defined by the
+ * %GST_VIDEO_BUFFER_TFF flag setting) is to be displayed.
+ *
+ * Since: 0.10.23
+ */
+#define GST_VIDEO_BUFFER_ONEFIELD GST_BUFFER_FLAG_MEDIA3
+
/* functions */
#ifdef __SYMBIAN32__
IMPORT_C
@@ -260,6 +302,11 @@
IMPORT_C
#endif
+gboolean gst_video_format_parse_caps_interlaced (GstCaps *caps, gboolean *interlaced);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
gboolean gst_video_parse_caps_framerate (GstCaps *caps,
int *fps_n, int *fps_d);
#ifdef __SYMBIAN32__
@@ -279,6 +326,13 @@
IMPORT_C
#endif
+GstCaps * gst_video_format_new_caps_interlaced (GstVideoFormat format,
+ int width, int height, int framerate_n, int framerate_d,
+ int par_n, int par_d, gboolean interlaced);
+#ifdef __SYMBIAN32__
+IMPORT_C
+#endif
+
GstVideoFormat gst_video_format_from_fourcc (guint32 fourcc);
#ifdef __SYMBIAN32__
IMPORT_C
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/adder/gstadder.c
--- a/gst_plugins_base/gst/adder/gstadder.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/adder/gstadder.c Wed Mar 24 18:04:17 2010 -0500
@@ -23,22 +23,17 @@
/**
* SECTION:element-adder
*
+ * The adder allows to mix several streams into one by adding the data.
+ * Mixed data is clamped to the min/max values of the data format.
+ *
+ * The adder currently mixes all data received on the sinkpads as soon as
+ * possible without trying to synchronize the streams.
+ *
*
- *
- * The Adder allows to mix several streams into one by adding the data.
- * Mixed data is clamped to the min/max values of the data format.
- *
* Example launch line
- *
- *
+ * |[
* gst-launch audiotestsrc freq=100 ! adder name=mix ! audioconvert ! alsasink audiotestsrc freq=500 ! mix.
- *
- * This pipeline produces two sine waves mixed together.
- *
- *
- * The Adder currently mixes all data received on the sinkpads as soon as possible
- * without trying to synchronize the streams.
- *
+ * ]| This pipeline produces two sine waves mixed together.
*
*
* Last reviewed on 2006-05-09 (0.10.7)
@@ -51,10 +46,7 @@
#include "gstadder.h"
#include
#include /* strcmp */
-
-#ifdef __SYMBIAN32__
-#include
-#endif
+/*#include */
/* highest positive/lowest negative x-bit value we can use for clamping */
#define MAX_INT_32 ((gint32) (0x7fffffff))
@@ -71,34 +63,66 @@
#define MIN_UINT_16 ((guint16)(0x0000))
#define MIN_UINT_8 ((guint8) (0x00))
+enum
+{
+ PROP_0,
+ PROP_FILTER_CAPS
+};
+
#define GST_CAT_DEFAULT gst_adder_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
/* elementfactory information */
-static const GstElementDetails adder_details = GST_ELEMENT_DETAILS ("Adder",
- "Generic/Audio",
- "Add N audio channels together",
- "Thomas ");
+
+#define CAPS \
+ "audio/x-raw-int, " \
+ "rate = (int) [ 1, MAX ], " \
+ "channels = (int) [ 1, MAX ], " \
+ "endianness = (int) BYTE_ORDER, " \
+ "width = (int) 32, " \
+ "depth = (int) 32, " \
+ "signed = (boolean) { true, false } ;" \
+ "audio/x-raw-int, " \
+ "rate = (int) [ 1, MAX ], " \
+ "channels = (int) [ 1, MAX ], " \
+ "endianness = (int) BYTE_ORDER, " \
+ "width = (int) 16, " \
+ "depth = (int) 16, " \
+ "signed = (boolean) { true, false } ;" \
+ "audio/x-raw-int, " \
+ "rate = (int) [ 1, MAX ], " \
+ "channels = (int) [ 1, MAX ], " \
+ "endianness = (int) BYTE_ORDER, " \
+ "width = (int) 8, " \
+ "depth = (int) 8, " \
+ "signed = (boolean) { true, false } ;" \
+ "audio/x-raw-float, " \
+ "rate = (int) [ 1, MAX ], " \
+ "channels = (int) [ 1, MAX ], " \
+ "endianness = (int) BYTE_ORDER, " \
+ "width = (int) { 32, 64 }"
static GstStaticPadTemplate gst_adder_src_template =
- GST_STATIC_PAD_TEMPLATE ("src",
+GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; "
- GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS)
+ GST_STATIC_CAPS (CAPS)
);
static GstStaticPadTemplate gst_adder_sink_template =
- GST_STATIC_PAD_TEMPLATE ("sink%d",
+GST_STATIC_PAD_TEMPLATE ("sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
- GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; "
- GST_AUDIO_FLOAT_PAD_TEMPLATE_CAPS)
+ GST_STATIC_CAPS (CAPS)
);
static void gst_adder_class_init (GstAdderClass * klass);
static void gst_adder_init (GstAdder * adder);
-static void gst_adder_finalize (GObject * object);
+static void gst_adder_dispose (GObject * object);
+static void gst_adder_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec);
+static void gst_adder_get_property (GObject * object, guint prop_id,
+ GValue * value, GParamSpec * pspec);
static gboolean gst_adder_setcaps (GstPad * pad, GstCaps * caps);
static gboolean gst_adder_query (GstPad * pad, GstQuery * query);
@@ -142,34 +166,70 @@
return adder_type;
}
-/* clipping versions */
+/* clipping versions (for int)
+ * FIXME: what about: oil_add_s16 (out, out, in, bytes / sizeof (type))
+ */
#define MAKE_FUNC(name,type,ttype,min,max) \
static void name (type *out, type *in, gint bytes) { \
gint i; \
+ ttype add; \
+ for (i = 0; i < bytes / sizeof (type); i++) { \
+ add = (ttype)out[i] + (ttype)in[i]; \
+ out[i] = CLAMP (add, min, max); \
+ } \
+}
+
+/* unsigned versions (for int) */
+#define MAKE_FUNC_US(name,type,ttype,max) \
+static void name (type *out, type *in, gint bytes) { \
+ gint i; \
+ ttype add; \
+ for (i = 0; i < bytes / sizeof (type); i++) { \
+ add = (ttype)out[i] + (ttype)in[i]; \
+ out[i] = ((add <= max) ? add : max); \
+ } \
+}
+
+/* non-clipping versions (for float) */
+#define MAKE_FUNC_NC(name,type) \
+static void name (type *out, type *in, gint bytes) { \
+ gint i; \
for (i = 0; i < bytes / sizeof (type); i++) \
- out[i] = CLAMP ((ttype)out[i] + (ttype)in[i], min, max); \
+ out[i] += in[i]; \
}
-/* non-clipping versions (for float) */
-#define MAKE_FUNC_NC(name,type,ttype) \
-static void name (type *out, type *in, gint bytes) { \
- gint i; \
- for (i = 0; i < bytes / sizeof (type); i++) \
- out[i] = (ttype)out[i] + (ttype)in[i]; \
+#if 0
+/* right now, the liboil function don't seems to be faster on x86
+ * time gst-launch audiotestsrc num-buffers=50000 ! audio/x-raw-float ! adder name=m ! fakesink audiotestsrc num-buffers=50000 ! audio/x-raw-float ! m.
+ * time gst-launch audiotestsrc num-buffers=50000 ! audio/x-raw-float,width=32 ! adder name=m ! fakesink audiotestsrc num-buffers=50000 ! audio/x-raw-float,width=32 ! m.
+ */
+static void
+add_float32 (gfloat * out, gfloat * in, gint bytes)
+{
+ oil_add_f32 (out, out, in, bytes / sizeof (gfloat));
}
+static void
+add_float64 (gdouble * out, gdouble * in, gint bytes)
+{
+ oil_add_f64 (out, out, in, bytes / sizeof (gdouble));
+}
+#endif
+
/* *INDENT-OFF* */
MAKE_FUNC (add_int32, gint32, gint64, MIN_INT_32, MAX_INT_32)
MAKE_FUNC (add_int16, gint16, gint32, MIN_INT_16, MAX_INT_16)
MAKE_FUNC (add_int8, gint8, gint16, MIN_INT_8, MAX_INT_8)
-MAKE_FUNC (add_uint32, guint32, guint64, MIN_UINT_32, MAX_UINT_32)
-MAKE_FUNC (add_uint16, guint16, guint32, MIN_UINT_16, MAX_UINT_16)
-MAKE_FUNC (add_uint8, guint8, guint16, MIN_UINT_8, MAX_UINT_8)
-MAKE_FUNC_NC (add_float64, gdouble, gdouble)
-MAKE_FUNC_NC (add_float32, gfloat, gfloat)
+MAKE_FUNC_US (add_uint32, guint32, guint64, MAX_UINT_32)
+MAKE_FUNC_US (add_uint16, guint16, guint32, MAX_UINT_16)
+MAKE_FUNC_US (add_uint8, guint8, guint16, MAX_UINT_8)
+MAKE_FUNC_NC (add_float64, gdouble)
+MAKE_FUNC_NC (add_float32, gfloat)
/* *INDENT-ON* */
-/* we can only accept caps that we and downstream can handle. */
+/* we can only accept caps that we and downstream can handle.
+ * if we have filtercaps set, use those to constrain the target caps.
+ */
static GstCaps *
gst_adder_sink_getcaps (GstPad * pad)
{
@@ -181,10 +241,17 @@
GST_OBJECT_LOCK (adder);
/* get the downstream possible caps */
peercaps = gst_pad_peer_get_caps (adder->srcpad);
+
/* get the allowed caps on this sinkpad, we use the fixed caps function so
* that it does not call recursively in this function. */
sinkcaps = gst_pad_get_fixed_caps_func (pad);
if (peercaps) {
+ /* restrict with filter-caps if any */
+ if (adder->filter_caps) {
+ result = gst_caps_intersect (peercaps, adder->filter_caps);
+ gst_caps_unref (peercaps);
+ peercaps = result;
+ }
/* if the peer has caps, intersect */
GST_DEBUG_OBJECT (adder, "intersecting peer and template caps");
result = gst_caps_intersect (peercaps, sinkcaps);
@@ -198,12 +265,15 @@
}
GST_OBJECT_UNLOCK (adder);
+ GST_LOG_OBJECT (adder, "getting caps on pad %p,%s to %" GST_PTR_FORMAT, pad,
+ GST_PAD_NAME (pad), result);
+
return result;
}
/* the first caps we receive on any of the sinkpads will define the caps for all
* the other sinkpads because we can only mix streams with the same caps.
- * */
+ */
static gboolean
gst_adder_setcaps (GstPad * pad, GstCaps * caps)
{
@@ -235,13 +305,15 @@
structure = gst_caps_get_structure (caps, 0);
media_type = gst_structure_get_name (structure);
if (strcmp (media_type, "audio/x-raw-int") == 0) {
- GST_DEBUG_OBJECT (adder, "parse_caps sets adder to format int");
adder->format = GST_ADDER_FORMAT_INT;
gst_structure_get_int (structure, "width", &adder->width);
gst_structure_get_int (structure, "depth", &adder->depth);
gst_structure_get_int (structure, "endianness", &adder->endianness);
gst_structure_get_boolean (structure, "signed", &adder->is_signed);
+ GST_INFO_OBJECT (pad, "parse_caps sets adder to format int, %d bit",
+ adder->width);
+
if (adder->endianness != G_BYTE_ORDER)
goto not_supported;
@@ -262,9 +334,15 @@
goto not_supported;
}
} else if (strcmp (media_type, "audio/x-raw-float") == 0) {
- GST_DEBUG_OBJECT (adder, "parse_caps sets adder to format float");
adder->format = GST_ADDER_FORMAT_FLOAT;
gst_structure_get_int (structure, "width", &adder->width);
+ gst_structure_get_int (structure, "endianness", &adder->endianness);
+
+ GST_INFO_OBJECT (pad, "parse_caps sets adder to format float, %d bit",
+ adder->width);
+
+ if (adder->endianness != G_BYTE_ORDER)
+ goto not_supported;
switch (adder->width) {
case 32:
@@ -330,6 +408,7 @@
it = gst_element_iterate_sink_pads (GST_ELEMENT_CAST (adder));
while (!done) {
GstIteratorResult ires;
+
gpointer item;
ires = gst_iterator_next (it, &item);
@@ -340,6 +419,7 @@
case GST_ITERATOR_OK:
{
GstPad *pad = GST_PAD_CAST (item);
+
gint64 duration;
/* ask sink peer for duration */
@@ -355,11 +435,13 @@
else if (duration > max)
max = duration;
}
+ gst_object_unref (pad);
break;
}
case GST_ITERATOR_RESYNC:
max = -1;
res = TRUE;
+ gst_iterator_resync (it);
break;
default:
res = FALSE;
@@ -371,6 +453,8 @@
if (res) {
/* and store the max */
+ GST_DEBUG_OBJECT (adder, "Total duration in format %s: %"
+ GST_TIME_FORMAT, gst_format_get_name (format), GST_TIME_ARGS (max));
gst_query_set_duration (query, format, max);
}
@@ -378,6 +462,91 @@
}
static gboolean
+gst_adder_query_latency (GstAdder * adder, GstQuery * query)
+{
+ GstClockTime min, max;
+ gboolean live;
+ gboolean res;
+ GstIterator *it;
+ gboolean done;
+
+ res = TRUE;
+ done = FALSE;
+
+ live = FALSE;
+ min = 0;
+ max = GST_CLOCK_TIME_NONE;
+
+ /* Take maximum of all latency values */
+ it = gst_element_iterate_sink_pads (GST_ELEMENT_CAST (adder));
+ while (!done) {
+ GstIteratorResult ires;
+
+ gpointer item;
+
+ ires = gst_iterator_next (it, &item);
+ switch (ires) {
+ case GST_ITERATOR_DONE:
+ done = TRUE;
+ break;
+ case GST_ITERATOR_OK:
+ {
+ GstPad *pad = GST_PAD_CAST (item);
+ GstQuery *peerquery;
+ GstClockTime min_cur, max_cur;
+ gboolean live_cur;
+
+ peerquery = gst_query_new_latency ();
+
+ /* Ask peer for latency */
+ res &= gst_pad_peer_query (pad, peerquery);
+
+ /* take max from all valid return values */
+ if (res) {
+ gst_query_parse_latency (peerquery, &live_cur, &min_cur, &max_cur);
+
+ if (min_cur > min)
+ min = min_cur;
+
+ if (max_cur != GST_CLOCK_TIME_NONE &&
+ ((max != GST_CLOCK_TIME_NONE && max_cur > max) ||
+ (max == GST_CLOCK_TIME_NONE)))
+ max = max_cur;
+
+ live = live || live_cur;
+ }
+
+ gst_query_unref (peerquery);
+ gst_object_unref (pad);
+ break;
+ }
+ case GST_ITERATOR_RESYNC:
+ live = FALSE;
+ min = 0;
+ max = GST_CLOCK_TIME_NONE;
+ res = TRUE;
+ gst_iterator_resync (it);
+ break;
+ default:
+ res = FALSE;
+ done = TRUE;
+ break;
+ }
+ }
+ gst_iterator_free (it);
+
+ if (res) {
+ /* store the results */
+ GST_DEBUG_OBJECT (adder, "Calculated total latency: live %s, min %"
+ GST_TIME_FORMAT ", max %" GST_TIME_FORMAT,
+ (live ? "yes" : "no"), GST_TIME_ARGS (min), GST_TIME_ARGS (max));
+ gst_query_set_latency (query, live, min, max);
+ }
+
+ return res;
+}
+
+static gboolean
gst_adder_query (GstPad * pad, GstQuery * query)
{
GstAdder *adder = GST_ADDER (gst_pad_get_parent (pad));
@@ -408,6 +577,9 @@
case GST_QUERY_DURATION:
res = gst_adder_query_duration (adder, query);
break;
+ case GST_QUERY_LATENCY:
+ res = gst_adder_query_latency (adder, query);
+ break;
default:
/* FIXME, needs a custom query handler because we have multiple
* sinkpads */
@@ -419,20 +591,34 @@
return res;
}
+typedef struct
+{
+ GstEvent *event;
+ gboolean flush;
+} EventData;
+
static gboolean
-forward_event_func (GstPad * pad, GValue * ret, GstEvent * event)
+forward_event_func (GstPad * pad, GValue * ret, EventData * data)
{
+ GstEvent *event = data->event;
+
gst_event_ref (event);
GST_LOG_OBJECT (pad, "About to send event %s", GST_EVENT_TYPE_NAME (event));
if (!gst_pad_push_event (pad, event)) {
g_value_set_boolean (ret, FALSE);
GST_WARNING_OBJECT (pad, "Sending event %p (%s) failed.",
event, GST_EVENT_TYPE_NAME (event));
+ /* quick hack to unflush the pads, ideally we need a way to just unflush
+ * this single collect pad */
+ if (data->flush)
+ gst_pad_send_event (pad, gst_event_new_flush_stop ());
} else {
GST_LOG_OBJECT (pad, "Sent event %p (%s).",
event, GST_EVENT_TYPE_NAME (event));
}
gst_object_unref (pad);
+
+ /* continue on other pads, even if one failed */
return TRUE;
}
@@ -443,27 +629,48 @@
* sinkpads.
*/
static gboolean
-forward_event (GstAdder * adder, GstEvent * event)
+forward_event (GstAdder * adder, GstEvent * event, gboolean flush)
{
gboolean ret;
GstIterator *it;
+ GstIteratorResult ires;
GValue vret = { 0 };
+ EventData data;
GST_LOG_OBJECT (adder, "Forwarding event %p (%s)", event,
GST_EVENT_TYPE_NAME (event));
ret = TRUE;
+ data.event = event;
+ data.flush = flush;
g_value_init (&vret, G_TYPE_BOOLEAN);
g_value_set_boolean (&vret, TRUE);
it = gst_element_iterate_sink_pads (GST_ELEMENT_CAST (adder));
- gst_iterator_fold (it, (GstIteratorFoldFunction) forward_event_func, &vret,
- event);
+ while (TRUE) {
+ ires = gst_iterator_fold (it, (GstIteratorFoldFunction) forward_event_func,
+ &vret, &data);
+ switch (ires) {
+ case GST_ITERATOR_RESYNC:
+ GST_WARNING ("resync");
+ gst_iterator_resync (it);
+ g_value_set_boolean (&vret, TRUE);
+ break;
+ case GST_ITERATOR_OK:
+ case GST_ITERATOR_DONE:
+ ret = g_value_get_boolean (&vret);
+ goto done;
+ default:
+ ret = FALSE;
+ goto done;
+ }
+ }
+done:
gst_iterator_free (it);
+ GST_LOG_OBJECT (adder, "Forwarded event %p (%s), ret=%d", event,
+ GST_EVENT_TYPE_NAME (event), ret);
gst_event_unref (event);
- ret = g_value_get_boolean (&vret);
-
return ret;
}
@@ -476,22 +683,21 @@
adder = GST_ADDER (gst_pad_get_parent (pad));
switch (GST_EVENT_TYPE (event)) {
- case GST_EVENT_QOS:
- /* QoS might be tricky */
- result = FALSE;
- break;
case GST_EVENT_SEEK:
{
GstSeekFlags flags;
GstSeekType curtype;
gint64 cur;
+ gboolean flush;
/* parse the seek parameters */
gst_event_parse_seek (event, &adder->segment_rate, NULL, &flags, &curtype,
&cur, NULL, NULL);
+ flush = (flags & GST_SEEK_FLAG_FLUSH) == GST_SEEK_FLAG_FLUSH;
+
/* check if we are flushing */
- if (flags & GST_SEEK_FLAG_FLUSH) {
+ if (flush) {
/* make sure we accept nothing anymore and return WRONG_STATE */
gst_collect_pads_set_flushing (adder->collect, TRUE);
@@ -499,27 +705,56 @@
* when all pads received a FLUSH_STOP. */
gst_pad_push_event (adder->srcpad, gst_event_new_flush_start ());
}
+ GST_DEBUG_OBJECT (adder, "handling seek event: %" GST_PTR_FORMAT, event);
/* now wait for the collected to be finished and mark a new
- * segment */
+ * segment. After we have the lock, no collect function is running and no
+ * new collect function will be called for as long as we're flushing. */
GST_OBJECT_LOCK (adder->collect);
if (curtype == GST_SEEK_TYPE_SET)
adder->segment_position = cur;
else
adder->segment_position = 0;
+ /* make sure we push a new segment, to inform about new basetime
+ * see FIXME in gst_adder_collected() */
adder->segment_pending = TRUE;
+ if (flush) {
+ /* Yes, we need to call _set_flushing again *WHEN* the streaming threads
+ * have stopped so that the cookie gets properly updated. */
+ gst_collect_pads_set_flushing (adder->collect, TRUE);
+ }
+ /* we might have a pending flush_stop event now. This event will either be
+ * sent by an upstream element when it completes the seek or we will push
+ * one in the collected callback ourself */
+ adder->flush_stop_pending = flush;
GST_OBJECT_UNLOCK (adder->collect);
+ GST_DEBUG_OBJECT (adder, "forwarding seek event: %" GST_PTR_FORMAT,
+ event);
- result = forward_event (adder, event);
+ result = forward_event (adder, event, flush);
+ if (!result) {
+ /* seek failed. maybe source is a live source. */
+ GST_DEBUG_OBJECT (adder, "seeking failed");
+ }
+ /* FIXME: ideally we would like to send a flush-stop event from here but
+ * collectpads does not have a method that allows us to do that. Instead
+ * we forward all flush-stop events we receive on the sinkpads. We might
+ * be sending too many flush-stop events. */
break;
}
+ case GST_EVENT_QOS:
+ /* QoS might be tricky */
+ result = FALSE;
+ break;
case GST_EVENT_NAVIGATION:
/* navigation is rather pointless. */
result = FALSE;
break;
default:
/* just forward the rest for now */
- result = forward_event (adder, event);
+ GST_DEBUG_OBJECT (adder, "forward unhandled event: %s",
+ GST_EVENT_TYPE_NAME (event));
+ result = forward_event (adder, event, FALSE);
break;
}
gst_object_unref (adder);
@@ -531,7 +766,7 @@
gst_adder_sink_event (GstPad * pad, GstEvent * event)
{
GstAdder *adder;
- gboolean ret;
+ gboolean ret = TRUE;
adder = GST_ADDER (gst_pad_get_parent (pad));
@@ -540,14 +775,30 @@
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_STOP:
- /* mark a pending new segment. This event is synchronized
- * with the streaming thread so we can safely update the
- * variable without races. It's somewhat weird because we
- * assume the collectpads forwarded the FLUSH_STOP past us
- * and downstream (using our source pad, the bastard!).
+ /* we received a flush-stop. The collect_event function will push the
+ * event past our element. We simply forward all flush-stop events, even
+ * when no flush-stop was pendingk, this is required because collectpads
+ * does not provide an API to handle-but-not-forward the flush-stop.
+ * We unset the pending flush-stop flag so that we don't send anymore
+ * flush-stop from the collect function later.
*/
+ GST_OBJECT_LOCK (adder->collect);
adder->segment_pending = TRUE;
+ adder->flush_stop_pending = FALSE;
+ /* Clear pending tags */
+ if (adder->pending_events) {
+ g_list_foreach (adder->pending_events, (GFunc) gst_event_unref, NULL);
+ g_list_free (adder->pending_events);
+ adder->pending_events = NULL;
+ }
+ GST_OBJECT_UNLOCK (adder->collect);
break;
+ case GST_EVENT_TAG:
+ GST_OBJECT_LOCK (adder->collect);
+ /* collectpads is a pile of horse manure. */
+ adder->pending_events = g_list_append (adder->pending_events, event);
+ GST_OBJECT_UNLOCK (adder->collect);
+ goto beach;
default:
break;
}
@@ -555,6 +806,7 @@
/* now GstCollectPads can take care of the rest, e.g. EOS */
ret = adder->collect_event (pad, event);
+beach:
gst_object_unref (adder);
return ret;
}
@@ -562,26 +814,40 @@
static void
gst_adder_class_init (GstAdderClass * klass)
{
- GObjectClass *gobject_class;
- GstElementClass *gstelement_class;
+ GObjectClass *gobject_class = (GObjectClass *) klass;
+ GstElementClass *gstelement_class = (GstElementClass *) klass;
- gobject_class = (GObjectClass *) klass;
-
- gobject_class->finalize = gst_adder_finalize;
-
- gstelement_class = (GstElementClass *) klass;
+ gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_adder_set_property);
+ gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_adder_get_property);
+ gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_adder_dispose);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_adder_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_adder_sink_template));
- gst_element_class_set_details (gstelement_class, &adder_details);
+ gst_element_class_set_details_simple (gstelement_class, "Adder",
+ "Generic/Audio",
+ "Add N audio channels together",
+ "Thomas Vander Stichele ");
parent_class = g_type_class_peek_parent (klass);
- gstelement_class->request_new_pad = gst_adder_request_new_pad;
- gstelement_class->release_pad = gst_adder_release_pad;
- gstelement_class->change_state = gst_adder_change_state;
+ /**
+ * GstAdder:caps:
+ *
+ * Since: 0.10.24
+ */
+ g_object_class_install_property (gobject_class, PROP_FILTER_CAPS,
+ g_param_spec_boxed ("caps", "Target caps",
+ "Set target format for mixing (NULL means ANY). "
+ "Setting this property takes a reference to the supplied GstCaps "
+ "object.", GST_TYPE_CAPS,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ gstelement_class->request_new_pad =
+ GST_DEBUG_FUNCPTR (gst_adder_request_new_pad);
+ gstelement_class->release_pad = GST_DEBUG_FUNCPTR (gst_adder_release_pad);
+ gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_adder_change_state);
}
static void
@@ -592,6 +858,7 @@
template = gst_static_pad_template_get (&gst_adder_src_template);
adder->srcpad = gst_pad_new_from_template (template, "src");
gst_object_unref (template);
+
gst_pad_set_getcaps_function (adder->srcpad,
GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
gst_pad_set_setcaps_function (adder->srcpad,
@@ -606,6 +873,8 @@
adder->padcount = 0;
adder->func = NULL;
+ adder->filter_caps = gst_caps_new_any ();
+
/* keep track of the sinkpads requested */
adder->collect = gst_collect_pads_new ();
gst_collect_pads_set_function (adder->collect,
@@ -613,16 +882,78 @@
}
static void
-gst_adder_finalize (GObject * object)
+gst_adder_dispose (GObject * object)
+{
+ GstAdder *adder = GST_ADDER (object);
+
+ if (adder->collect) {
+ gst_object_unref (adder->collect);
+ adder->collect = NULL;
+ }
+ gst_caps_replace (&adder->filter_caps, NULL);
+ if (adder->pending_events) {
+ g_list_foreach (adder->pending_events, (GFunc) gst_event_unref, NULL);
+ g_list_free (adder->pending_events);
+ adder->pending_events = NULL;
+ }
+
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+gst_adder_set_property (GObject * object, guint prop_id,
+ const GValue * value, GParamSpec * pspec)
{
GstAdder *adder = GST_ADDER (object);
- gst_object_unref (adder->collect);
- adder->collect = NULL;
+ switch (prop_id) {
+ case PROP_FILTER_CAPS:{
+ GstCaps *new_caps;
+ GstCaps *old_caps;
+ const GstCaps *new_caps_val = gst_value_get_caps (value);
+
+ if (new_caps_val == NULL) {
+ new_caps = gst_caps_new_any ();
+ } else {
+ new_caps = (GstCaps *) new_caps_val;
+ gst_caps_ref (new_caps);
+ }
+
+ GST_OBJECT_LOCK (adder);
+ old_caps = adder->filter_caps;
+ adder->filter_caps = new_caps;
+ GST_OBJECT_UNLOCK (adder);
+
+ gst_caps_unref (old_caps);
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ GST_DEBUG_OBJECT (adder, "set new caps %" GST_PTR_FORMAT, new_caps);
+ break;
+ }
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
}
+static void
+gst_adder_get_property (GObject * object, guint prop_id, GValue * value,
+ GParamSpec * pspec)
+{
+ GstAdder *adder = GST_ADDER (object);
+
+ switch (prop_id) {
+ case PROP_FILTER_CAPS:
+ GST_OBJECT_LOCK (adder);
+ gst_value_set_caps (value, adder->filter_caps);
+ GST_OBJECT_UNLOCK (adder);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+
static GstPad *
gst_adder_request_new_pad (GstElement * element, GstPadTemplate * templ,
const gchar * unused)
@@ -694,7 +1025,7 @@
gst_adder_collected (GstCollectPads * pads, gpointer user_data)
{
/*
- * combine channels by adding sample values
+ * combine streams by adding data values
* basic algorithm :
* - this function is called when all pads have a buffer
* - get available bytes on all pads.
@@ -702,13 +1033,19 @@
* - read available bytes, copy or add to target buffer
* - if there's an EOS event, remove the input channel
* - push out the output buffer
+ *
+ * todo:
+ * - would be nice to have a mixing mode, where instead of adding we mix
+ * - for float we could downscale after collect loop
+ * - for int we need to downscale each input to avoid clipping or
+ * mix into a temp (float) buffer and scale afterwards as well
*/
GstAdder *adder;
- guint size;
GSList *collected;
- GstBuffer *outbuf;
GstFlowReturn ret;
- gpointer outbytes;
+ GstBuffer *outbuf = NULL;
+ gpointer outdata = NULL;
+ guint outsize;
gboolean empty = TRUE;
adder = GST_ADDER (user_data);
@@ -717,79 +1054,80 @@
if (G_UNLIKELY (adder->func == NULL))
goto not_negotiated;
- /* get available bytes for reading, this can be 0 which could mean
- * empty buffers or EOS, which we will catch when we loop over the
- * pads. */
- size = gst_collect_pads_available (pads);
+ if (adder->flush_stop_pending) {
+ gst_pad_push_event (adder->srcpad, gst_event_new_flush_stop ());
+ adder->flush_stop_pending = FALSE;
+ }
+
+ /* get available bytes for reading, this can be 0 which could mean empty
+ * buffers or EOS, which we will catch when we loop over the pads. */
+ outsize = gst_collect_pads_available (pads);
GST_LOG_OBJECT (adder,
- "starting to cycle through channels, %d bytes available (bps = %d)", size,
- adder->bps);
-
- outbuf = NULL;
- outbytes = NULL;
+ "starting to cycle through channels, %d bytes available (bps = %d)",
+ outsize, adder->bps);
for (collected = pads->data; collected; collected = g_slist_next (collected)) {
- GstCollectData *data;
- guint8 *bytes;
- guint len;
+ GstCollectData *collect_data;
GstBuffer *inbuf;
+ guint8 *indata;
+ guint insize;
- data = (GstCollectData *) collected->data;
+ collect_data = (GstCollectData *) collected->data;
/* get a subbuffer of size bytes */
- inbuf = gst_collect_pads_take_buffer (pads, data, size);
+ inbuf = gst_collect_pads_take_buffer (pads, collect_data, outsize);
/* NULL means EOS or an empty buffer so we still need to flush in
* case of an empty buffer. */
if (inbuf == NULL) {
- GST_LOG_OBJECT (adder, "channel %p: no bytes available", data);
- goto next;
+ GST_LOG_OBJECT (adder, "channel %p: no bytes available", collect_data);
+ continue;
}
- bytes = GST_BUFFER_DATA (inbuf);
- len = GST_BUFFER_SIZE (inbuf);
+ indata = GST_BUFFER_DATA (inbuf);
+ insize = GST_BUFFER_SIZE (inbuf);
if (outbuf == NULL) {
GST_LOG_OBJECT (adder, "channel %p: making output buffer of %d bytes",
- data, size);
+ collect_data, outsize);
- /* first buffer, alloc size bytes. FIXME, we can easily subbuffer
- * and _make_writable. */
- outbuf = gst_buffer_new_and_alloc (size);
- outbytes = GST_BUFFER_DATA (outbuf);
+ /* first buffer, alloc outsize.
+ * FIXME: we can easily subbuffer and _make_writable.
+ * FIXME: only create empty buffer for first non-gap buffer, so that we
+ * only use adder function when really adding
+ */
+ outbuf = gst_buffer_new_and_alloc (outsize);
+ outdata = GST_BUFFER_DATA (outbuf);
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (adder->srcpad));
if (!GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_GAP)) {
+ GST_LOG_OBJECT (adder, "channel %p: copying %d bytes from data %p",
+ collect_data, insize, indata);
/* clear if we are only going to fill a partial buffer */
- if (G_UNLIKELY (size > len))
- memset (outbytes, 0, size);
-
- GST_LOG_OBJECT (adder, "channel %p: copying %d bytes from data %p",
- data, len, bytes);
-
+ if (G_UNLIKELY (outsize > insize))
+ memset ((guint8 *) outdata + insize, 0, outsize - insize);
/* and copy the data into it */
- memcpy (outbytes, bytes, len);
+ memcpy (outdata, indata, insize);
empty = FALSE;
} else {
+ /* clear whole buffer */
GST_LOG_OBJECT (adder, "channel %p: zeroing %d bytes from data %p",
- data, len, bytes);
- memset (outbytes, 0, size);
+ collect_data, insize, indata);
+ memset (outdata, 0, outsize);
}
} else {
if (!GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_GAP)) {
GST_LOG_OBJECT (adder, "channel %p: mixing %d bytes from data %p",
- data, len, bytes);
- /* other buffers, need to add them */
- adder->func ((gpointer) outbytes, (gpointer) bytes, len);
+ collect_data, insize, indata);
+ /* further buffers, need to add them */
+ adder->func ((gpointer) outdata, (gpointer) indata, insize);
empty = FALSE;
} else {
GST_LOG_OBJECT (adder, "channel %p: skipping %d bytes from data %p",
- data, len, bytes);
+ collect_data, insize, indata);
}
}
- next:
- if (inbuf)
- gst_buffer_unref (inbuf);
+ gst_buffer_unref (inbuf);
}
/* can only happen when no pads to collect or all EOS */
@@ -818,9 +1156,31 @@
event = gst_event_new_new_segment_full (FALSE, adder->segment_rate,
1.0, GST_FORMAT_TIME, adder->timestamp, -1, adder->segment_position);
- gst_pad_push_event (adder->srcpad, event);
- adder->segment_pending = FALSE;
- adder->segment_position = 0;
+ if (event) {
+ if (!gst_pad_push_event (adder->srcpad, event)) {
+ GST_WARNING_OBJECT (adder->srcpad, "Sending event %p (%s) failed.",
+ event, GST_EVENT_TYPE_NAME (event));
+ }
+ adder->segment_pending = FALSE;
+ adder->segment_position = 0;
+ } else {
+ GST_WARNING_OBJECT (adder->srcpad, "Creating new segment event for "
+ "start:%" G_GINT64_FORMAT " pos:%" G_GINT64_FORMAT " failed",
+ adder->timestamp, adder->segment_position);
+ }
+ }
+
+ if (G_UNLIKELY (adder->pending_events)) {
+ GList *tmp = adder->pending_events;
+
+ while (tmp) {
+ GstEvent *ev = (GstEvent *) tmp->data;
+
+ gst_pad_push_event (adder->srcpad, ev);
+ tmp = g_list_next (tmp);
+ }
+ g_list_free (adder->pending_events);
+ adder->pending_events = NULL;
}
/* set timestamps on the output buffer */
@@ -829,7 +1189,7 @@
/* for the next timestamp, use the sample counter, which will
* never accumulate rounding errors */
- adder->offset += size / adder->bps;
+ adder->offset += outsize / adder->bps;
adder->timestamp = gst_util_uint64_scale_int (adder->offset,
GST_SECOND, adder->rate);
@@ -846,6 +1206,8 @@
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)));
ret = gst_pad_push (adder->srcpad, outbuf);
+ GST_LOG_OBJECT (adder, "pushed outbuf, result = %s", gst_flow_get_name (ret));
+
return ret;
/* ERRORS */
@@ -877,6 +1239,7 @@
case GST_STATE_CHANGE_READY_TO_PAUSED:
adder->timestamp = 0;
adder->offset = 0;
+ adder->flush_stop_pending = FALSE;
adder->segment_pending = TRUE;
adder->segment_position = 0;
adder->segment_rate = 1.0;
@@ -908,6 +1271,8 @@
static gboolean
plugin_init (GstPlugin * plugin)
{
+ /*oil_init (); */
+
if (!gst_element_register (plugin, "adder", GST_RANK_NONE, GST_TYPE_ADDER)) {
return FALSE;
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/adder/gstadder.h
--- a/gst_plugins_base/gst/adder/gstadder.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/adder/gstadder.h Wed Mar 24 18:04:17 2010 -0500
@@ -87,6 +87,14 @@
gboolean segment_pending;
guint64 segment_position;
gdouble segment_rate;
+ /* src event handling */
+ gboolean flush_stop_pending;
+
+ /* target caps */
+ GstCaps *filter_caps;
+
+ /* Pending inline events */
+ GList *pending_events;
};
struct _GstAdderClass {
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/app/gstapp.c
--- a/gst_plugins_base/gst/app/gstapp.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/app/gstapp.c Wed Mar 24 18:04:17 2010 -0500
@@ -44,7 +44,7 @@
#ifdef __SYMBIAN32__
EXPORT_C GstPluginDesc* _GST_PLUGIN_DESC()
{
- return &gst_plugin_desc;
+ return &gst_plugin_desc;
}
#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioconvert/audioconvert.c
--- a/gst_plugins_base/gst/audioconvert/audioconvert.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/audioconvert/audioconvert.c Wed Mar 24 18:04:17 2010 -0500
@@ -66,7 +66,6 @@
} \
}
-
/* unpack from float to float 64 (double) */
#define MAKE_UNPACK_FUNC_FF(name, type, FUNC) \
static void \
@@ -418,7 +417,8 @@
gboolean
audio_convert_prepare_context (AudioConvertCtx * ctx, AudioConvertFmt * in,
- AudioConvertFmt * out, DitherType dither, NoiseShapingType ns)
+ AudioConvertFmt * out, GstAudioConvertDithering dither,
+ GstAudioConvertNoiseShaping ns)
{
gint idx_in, idx_out;
@@ -429,6 +429,9 @@
/* first clean the existing context */
audio_convert_clean_context (ctx);
+ g_return_val_if_fail (in->unpositioned_layout == out->unpositioned_layout,
+ FALSE);
+
ctx->in = *in;
ctx->out = *out;
@@ -534,9 +537,9 @@
audio_convert_convert (AudioConvertCtx * ctx, gpointer src,
gpointer dst, gint samples, gboolean src_writable)
{
- gint insize, outsize, size;
+ guint insize, outsize, size;
gpointer outbuf, tmpbuf;
- gint intemp = 0, outtemp = 0, biggest;
+ guint intemp = 0, outtemp = 0, biggest;
g_return_val_if_fail (ctx != NULL, FALSE);
g_return_val_if_fail (src != NULL, FALSE);
@@ -554,9 +557,9 @@
: sizeof (gint32);
if (!ctx->in_default)
- intemp = insize * size * 8 / ctx->in.width;
+ intemp = gst_util_uint64_scale (insize, size * 8, ctx->in.width);
if (!ctx->mix_passthrough || !ctx->out_default)
- outtemp = outsize * size * 8 / ctx->out.width;
+ outtemp = gst_util_uint64_scale (outsize, size * 8, ctx->out.width);
biggest = MAX (intemp, outtemp);
/* see if one of the buffers can be used as temp */
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioconvert/audioconvert.h
--- a/gst_plugins_base/gst/audioconvert/audioconvert.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/audioconvert/audioconvert.h Wed Mar 24 18:04:17 2010 -0500
@@ -25,14 +25,33 @@
#include
#include
+/**
+ * GstAudioConvertDithering:
+ * @DITHER_NONE: No dithering
+ * @DITHER_RPDF: Rectangular dithering
+ * @DITHER_TPDF: Triangular dithering (default)
+ * @DITHER_TPDF_HF: High frequency triangular dithering
+ *
+ * Set of available dithering methods when converting audio.
+ */
typedef enum
{
DITHER_NONE = 0,
DITHER_RPDF,
DITHER_TPDF,
DITHER_TPDF_HF
-} DitherType;
+} GstAudioConvertDithering;
+/**
+ * GstAudioConvertNoiseShaping:
+ * @NOISE_SHAPING_NONE: No noise shaping (default)
+ * @NOISE_SHAPING_ERROR_FEEDBACK: Error feedback
+ * @NOISE_SHAPING_SIMPLE: Simple 2-pole noise shaping
+ * @NOISE_SHAPING_MEDIUM: Medium 5-pole noise shaping
+ * @NOISE_SHAPING_HIGH: High 8-pole noise shaping
+ *
+ * Set of available noise shaping methods
+ */
typedef enum
{
NOISE_SHAPING_NONE = 0,
@@ -40,7 +59,7 @@
NOISE_SHAPING_SIMPLE,
NOISE_SHAPING_MEDIUM,
NOISE_SHAPING_HIGH
-} NoiseShapingType;
+} GstAudioConvertNoiseShaping;
typedef struct _AudioConvertCtx AudioConvertCtx;
typedef struct _AudioConvertFmt AudioConvertFmt;
@@ -54,6 +73,7 @@
gint rate;
gint channels;
GstAudioChannelPosition *pos;
+ gboolean unpositioned_layout;
/* int audio caps */
gboolean sign;
@@ -98,10 +118,9 @@
AudioConvertMix channel_mix;
AudioConvertQuantize quantize;
- DitherType dither;
- NoiseShapingType ns;
- /* random number generate for dither noise */
- GRand *dither_random;
+
+ GstAudioConvertDithering dither;
+ GstAudioConvertNoiseShaping ns;
/* last random number generated per channel for hifreq TPDF dither */
gpointer last_random;
/* contains the past quantization errors, error[out_channels][count] */
@@ -119,8 +138,8 @@
gboolean audio_convert_prepare_context (AudioConvertCtx * ctx,
- AudioConvertFmt * in, AudioConvertFmt * out, DitherType dither,
- NoiseShapingType ns);
+ AudioConvertFmt * in, AudioConvertFmt * out,
+ GstAudioConvertDithering dither, GstAudioConvertNoiseShaping ns);
#ifdef __SYMBIAN32__
IMPORT_C
#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioconvert/gstaudioconvert.c
--- a/gst_plugins_base/gst/audioconvert/gstaudioconvert.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/audioconvert/gstaudioconvert.c Wed Mar 24 18:04:17 2010 -0500
@@ -24,31 +24,20 @@
/**
* SECTION:element-audioconvert
*
- *
- *
* Audioconvert converts raw audio buffers between various possible formats.
* It supports integer to float conversion, width/depth conversion,
- * signedness and endianness conversion.
- *
- *
- * Some format conversion are not carried out in an optimal way right now.
- * E.g. converting from double to float would cause a loss of precision.
- *
+ * signedness and endianness conversion and channel transformations.
+ *
+ *
* Example launch line
- *
- *
+ * |[
* gst-launch -v -m audiotestsrc ! audioconvert ! audio/x-raw-int,channels=2,width=8,depth=8 ! level ! fakesink silent=TRUE
- *
- * This pipeline converts audio to 8-bit. The level element shows that
+ * ]| This pipeline converts audio to 8-bit. The level element shows that
* the output levels still match the one for a sine wave.
- *
- *
- *
+ * |[
* gst-launch -v -m audiotestsrc ! audioconvert ! vorbisenc ! fakesink silent=TRUE
- *
- * The vorbis encoder takes float audio data instead of the integer data
+ * ]| The vorbis encoder takes float audio data instead of the integer data
* generated by audiotestsrc.
- *
*
*
* Last reviewed on 2006-03-02 (0.10.4)
@@ -107,7 +96,8 @@
const GValue * value, GParamSpec * pspec);
static void gst_audio_convert_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-
+static gboolean structure_has_fixed_channel_positions (GstStructure * s,
+ gboolean * unpositioned_layout);
/* AudioConvert signals and args */
enum
@@ -135,37 +125,37 @@
GST_STATIC_CAPS ( \
"audio/x-raw-float, " \
"rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, 8 ], " \
+ "channels = (int) [ 1, MAX ], " \
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
"width = (int) 64;" \
"audio/x-raw-float, " \
"rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, 8 ], " \
+ "channels = (int) [ 1, MAX ], " \
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
"width = (int) 32;" \
"audio/x-raw-int, " \
"rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, 8 ], " \
+ "channels = (int) [ 1, MAX ], " \
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
"width = (int) 32, " \
"depth = (int) [ 1, 32 ], " \
"signed = (boolean) { true, false }; " \
"audio/x-raw-int, " \
"rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, 8 ], " \
+ "channels = (int) [ 1, MAX ], " \
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
"width = (int) 24, " \
"depth = (int) [ 1, 24 ], " "signed = (boolean) { true, false }; " \
"audio/x-raw-int, " \
"rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, 8 ], " \
+ "channels = (int) [ 1, MAX ], " \
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
"width = (int) 16, " \
"depth = (int) [ 1, 16 ], " \
"signed = (boolean) { true, false }; " \
"audio/x-raw-int, " \
"rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, 8 ], " \
+ "channels = (int) [ 1, MAX ], " \
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
"width = (int) 8, " \
"depth = (int) [ 1, 8 ], " \
@@ -263,13 +253,14 @@
g_object_class_install_property (gobject_class, ARG_DITHERING,
g_param_spec_enum ("dithering", "Dithering",
"Selects between different dithering methods.",
- GST_TYPE_AUDIO_CONVERT_DITHERING, DITHER_TPDF, G_PARAM_READWRITE));
+ GST_TYPE_AUDIO_CONVERT_DITHERING, DITHER_TPDF,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, ARG_NOISE_SHAPING,
g_param_spec_enum ("noise-shaping", "Noise shaping",
"Selects between different noise shaping methods.",
GST_TYPE_AUDIO_CONVERT_NOISE_SHAPING, NOISE_SHAPING_NONE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
basetransform_class->get_unit_size =
GST_DEBUG_FUNCPTR (gst_audio_convert_get_unit_size);
@@ -293,6 +284,8 @@
this->dither = DITHER_TPDF;
this->ns = NOISE_SHAPING_NONE;
memset (&this->ctx, 0, sizeof (AudioConvertCtx));
+
+ gst_base_transform_set_gap_aware (GST_BASE_TRANSFORM (this), TRUE);
}
static void
@@ -330,6 +323,10 @@
goto no_values;
if (!(fmt->pos = gst_audio_get_channel_positions (structure)))
goto no_values;
+
+ fmt->unpositioned_layout = FALSE;
+ structure_has_fixed_channel_positions (structure, &fmt->unpositioned_layout);
+
if (!gst_structure_get_int (structure, "width", &fmt->width))
goto no_values;
if (!gst_structure_get_int (structure, "rate", &fmt->rate))
@@ -529,6 +526,40 @@
}
}
+static gboolean
+structure_has_fixed_channel_positions (GstStructure * s,
+ gboolean * unpositioned_layout)
+{
+ GstAudioChannelPosition *pos;
+ const GValue *val;
+ gint channels = 0;
+
+ if (!gst_structure_get_int (s, "channels", &channels))
+ return FALSE; /* probably a range */
+
+ val = gst_structure_get_value (s, "channel-positions");
+ if ((val == NULL || !gst_value_is_fixed (val)) && channels <= 8) {
+ GST_LOG ("no or unfixed channel-positions in %" GST_PTR_FORMAT, s);
+ return FALSE;
+ } else if (val == NULL || !gst_value_is_fixed (val)) {
+ GST_LOG ("implicit undefined channel-positions");
+ *unpositioned_layout = TRUE;
+ return TRUE;
+ }
+
+ pos = gst_audio_get_channel_positions (s);
+ if (pos && pos[0] == GST_AUDIO_CHANNEL_POSITION_NONE) {
+ GST_LOG ("fixed undefined channel-positions in %" GST_PTR_FORMAT, s);
+ *unpositioned_layout = TRUE;
+ } else {
+ GST_LOG ("fixed defined channel-positions in %" GST_PTR_FORMAT, s);
+ *unpositioned_layout = FALSE;
+ }
+ g_free (pos);
+
+ return TRUE;
+}
+
/* Audioconvert can perform all conversions on audio except for resampling.
* However, there are some conversions we _prefer_ not to do. For example, it's
* better to convert format (float<->int, endianness, etc) than the number of
@@ -546,8 +577,8 @@
{
GstCaps *ret;
GstStructure *s, *structure;
- gboolean isfloat;
- gint width, depth, channels;
+ gboolean isfloat, allow_mixing;
+ gint width, depth, channels = 0;
const gchar *fields_used[] = {
"width", "depth", "rate", "channels", "endianness", "signed"
};
@@ -603,11 +634,28 @@
}
}
+ allow_mixing = TRUE;
if (gst_structure_get_int (structure, "channels", &channels)) {
- if (channels == 8)
- gst_structure_set (s, "channels", G_TYPE_INT, 8, NULL);
+ gboolean unpositioned;
+
+ /* we don't support mixing for channels without channel positions */
+ if (structure_has_fixed_channel_positions (structure, &unpositioned))
+ allow_mixing = (unpositioned == FALSE);
+ }
+
+ if (!allow_mixing) {
+ gst_structure_set (s, "channels", G_TYPE_INT, channels, NULL);
+ if (gst_structure_has_field (structure, "channel-positions"))
+ gst_structure_set_value (s, "channel-positions",
+ gst_structure_get_value (structure, "channel-positions"));
+ } else {
+ if (channels == 0)
+ gst_structure_set (s, "channels", GST_TYPE_INT_RANGE, 1, 11, NULL);
+ else if (channels == 11)
+ gst_structure_set (s, "channels", G_TYPE_INT, 11, NULL);
else
- gst_structure_set (s, "channels", GST_TYPE_INT_RANGE, channels, 8, NULL);
+ gst_structure_set (s, "channels", GST_TYPE_INT_RANGE, channels, 11, NULL);
+ gst_structure_remove_field (s, "channel-positions");
}
gst_caps_append_structure (ret, s);
@@ -636,7 +684,16 @@
* it's very bad to drop channels entirely.
*/
s = gst_structure_copy (s);
- gst_structure_set (s, "channels", GST_TYPE_INT_RANGE, 1, 8, NULL);
+ if (allow_mixing) {
+ gst_structure_set (s, "channels", GST_TYPE_INT_RANGE, 1, 11, NULL);
+ gst_structure_remove_field (s, "channel-positions");
+ } else {
+ /* allow_mixing can only be FALSE if we got a fixed number of channels */
+ gst_structure_set (s, "channels", G_TYPE_INT, channels, NULL);
+ if (gst_structure_has_field (structure, "channel-positions"))
+ gst_structure_set_value (s, "channel-positions",
+ gst_structure_get_value (structure, "channel-positions"));
+ }
gst_caps_append_structure (ret, s);
/* Same, plus a float<->int conversion */
@@ -751,7 +808,7 @@
gst_audio_convert_fixate_channels (GstBaseTransform * base, GstStructure * ins,
GstStructure * outs)
{
- const GValue *out_layout;
+ const GValue *in_layout, *out_layout;
gint in_chans, out_chans;
if (!gst_structure_get_int (ins, "channels", &in_chans))
@@ -776,19 +833,18 @@
/* check if the output has a channel layout (or a list of layouts) */
out_layout = gst_structure_get_value (outs, "channel-positions");
+ /* get the channel layout of the input if any */
+ in_layout = gst_structure_get_value (ins, "channel-positions");
+
if (out_layout == NULL) {
- if (out_chans <= 2)
+ if (out_chans <= 2 && (in_chans != out_chans || in_layout == NULL))
return; /* nothing to do, default layout will be assumed */
GST_WARNING_OBJECT (base, "downstream caps contain no channel layout");
}
- if (in_chans == out_chans) {
- const GValue *in_layout;
+ if (in_chans == out_chans && in_layout != NULL) {
GValue res = { 0, };
- in_layout = gst_structure_get_value (ins, "channel-positions");
- g_return_if_fail (in_layout != NULL);
-
/* same number of channels and no output layout: just use input layout */
if (out_layout == NULL) {
gst_structure_set_value (outs, "channel-positions", in_layout);
@@ -846,7 +902,7 @@
* and try to add/remove channels from the input layout, or pick a default
* layout based on LFE-presence in input layout, but let's save that for
* another day) */
- if (out_chans > 0 && out_chans < G_N_ELEMENTS (default_positions[0])) {
+ if (out_chans > 0 && out_chans <= G_N_ELEMENTS (default_positions[0])) {
GST_DEBUG_OBJECT (base, "using default channel layout as fallback");
gst_audio_set_channel_positions (outs, default_positions[out_chans - 1]);
}
@@ -946,6 +1002,79 @@
return GST_FLOW_OK;
}
+static void
+gst_audio_convert_create_silence_buffer (GstAudioConvert * this, gpointer dst,
+ gint size)
+{
+ if (this->ctx.out.is_int && !this->ctx.out.sign) {
+ gint i;
+
+ switch (this->ctx.out.width) {
+ case 8:{
+ guint8 zero = 0x80 >> (8 - this->ctx.out.depth);
+
+ memset (dst, zero, size);
+ break;
+ }
+ case 16:{
+ guint16 *data = (guint16 *) dst;
+ guint16 zero = 0x8000 >> (16 - this->ctx.out.depth);
+
+ if (this->ctx.out.endianness == G_LITTLE_ENDIAN)
+ zero = GUINT16_TO_LE (zero);
+ else
+ zero = GUINT16_TO_BE (zero);
+
+ size /= 2;
+
+ for (i = 0; i < size; i++)
+ data[i] = zero;
+ break;
+ }
+ case 24:{
+ guint32 zero = 0x800000 >> (24 - this->ctx.out.depth);
+ guint8 *data = (guint8 *) dst;
+
+ if (this->ctx.out.endianness == G_LITTLE_ENDIAN) {
+ for (i = 0; i < size; i += 3) {
+ data[i] = zero & 0xff;
+ data[i + 1] = (zero >> 8) & 0xff;
+ data[i + 2] = (zero >> 16) & 0xff;
+ }
+ } else {
+ for (i = 0; i < size; i += 3) {
+ data[i + 2] = zero & 0xff;
+ data[i + 1] = (zero >> 8) & 0xff;
+ data[i] = (zero >> 16) & 0xff;
+ }
+ }
+ break;
+ }
+ case 32:{
+ guint32 *data = (guint32 *) dst;
+ guint32 zero = (0x80000000 >> (32 - this->ctx.out.depth));
+
+ if (this->ctx.out.endianness == G_LITTLE_ENDIAN)
+ zero = GUINT32_TO_LE (zero);
+ else
+ zero = GUINT32_TO_BE (zero);
+
+ size /= 4;
+
+ for (i = 0; i < size; i++)
+ data[i] = zero;
+ break;
+ }
+ default:
+ memset (dst, 0, size);
+ g_return_if_reached ();
+ break;
+ }
+ } else {
+ memset (dst, 0, size);
+ }
+}
+
static GstFlowReturn
gst_audio_convert_transform (GstBaseTransform * base, GstBuffer * inbuf,
GstBuffer * outbuf)
@@ -978,9 +1107,14 @@
dst = GST_BUFFER_DATA (outbuf);
/* and convert the samples */
- if (!(res = audio_convert_convert (&this->ctx, src, dst,
- samples, gst_buffer_is_writable (inbuf))))
- goto convert_error;
+ if (!GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_GAP)) {
+ if (!(res = audio_convert_convert (&this->ctx, src, dst,
+ samples, gst_buffer_is_writable (inbuf))))
+ goto convert_error;
+ } else {
+ /* Create silence buffer */
+ gst_audio_convert_create_silence_buffer (this, dst, outsize);
+ }
GST_BUFFER_SIZE (outbuf) = outsize;
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioconvert/gstaudioconvert.h
--- a/gst_plugins_base/gst/audioconvert/gstaudioconvert.h Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/audioconvert/gstaudioconvert.h Wed Mar 24 18:04:17 2010 -0500
@@ -48,8 +48,8 @@
AudioConvertCtx ctx;
- DitherType dither;
- NoiseShapingType ns;
+ GstAudioConvertDithering dither;
+ GstAudioConvertNoiseShaping ns;
};
struct _GstAudioConvertClass
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioconvert/gstaudioquantize.c
--- a/gst_plugins_base/gst/audioconvert/gstaudioquantize.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/audioconvert/gstaudioquantize.c Wed Mar 24 18:04:17 2010 -0500
@@ -37,6 +37,8 @@
#include "audioconvert.h"
#include "gstaudioquantize.h"
+#include "gstfastrandom.h"
+
#define MAKE_QUANTIZE_FUNC_NAME(name) \
gst_audio_quantize_quantize_##name
@@ -144,8 +146,8 @@
gint32 dither = (1<<(scale));
#define ADD_DITHER_RPDF_I() \
- rand = g_rand_int_range (ctx->dither_random, bias - dither, \
- bias + dither); \
+ rand = gst_fast_random_int32_range (bias - dither, \
+ bias + dither); \
if (rand > 0 && tmp > 0 && G_MAXINT32 - tmp <= rand) \
tmp = G_MAXINT32; \
else if (rand < 0 && tmp < 0 && G_MININT32 - tmp >= rand) \
@@ -157,8 +159,7 @@
gdouble dither = 1.0/(1U<<(32 - scale - 1));
#define ADD_DITHER_RPDF_F() \
- tmp += g_rand_double_range (ctx->dither_random, - dither, \
- dither);
+ tmp += gst_fast_random_double_range (- dither, dither);
#define INIT_DITHER_TPDF_I() \
gint32 rand; \
@@ -166,10 +167,10 @@
bias = bias >> 1;
#define ADD_DITHER_TPDF_I() \
- rand = g_rand_int_range (ctx->dither_random, bias - dither, \
- bias + dither - 1) \
- + g_rand_int_range (ctx->dither_random, bias - dither, \
- bias + dither - 1); \
+ rand = gst_fast_random_int32_range (bias - dither, \
+ bias + dither - 1) \
+ + gst_fast_random_int32_range (bias - dither, \
+ bias + dither - 1); \
if (rand > 0 && tmp > 0 && G_MAXINT32 - tmp <= rand) \
tmp = G_MAXINT32; \
else if (rand < 0 && tmp < 0 && G_MININT32 - tmp >= rand) \
@@ -181,10 +182,8 @@
gdouble dither = 1.0/(1U<<(32 - scale));
#define ADD_DITHER_TPDF_F() \
- tmp += g_rand_double_range (ctx->dither_random, - dither, \
- dither) \
- + g_rand_double_range (ctx->dither_random, - dither, \
- dither);
+ tmp += gst_fast_random_double_range (- dither, dither) \
+ + gst_fast_random_double_range (- dither, dither);
#define INIT_DITHER_TPDF_HF_I() \
gint32 rand; \
@@ -193,8 +192,8 @@
bias = bias >> 1;
#define ADD_DITHER_TPDF_HF_I() \
- tmp_rand = g_rand_int_range (ctx->dither_random, bias - dither, \
- bias + dither); \
+ tmp_rand = gst_fast_random_int32_range (bias - dither, \
+ bias + dither); \
rand = tmp_rand - last_random[chan_pos]; \
last_random[chan_pos] = tmp_rand; \
if (rand > 0 && tmp > 0 && G_MAXINT32 - tmp <= rand) \
@@ -213,8 +212,7 @@
gdouble *last_random = (gdouble *) ctx->last_random, tmp_rand;
#define ADD_DITHER_TPDF_HF_F() \
- tmp_rand = g_rand_double_range (ctx->dither_random, - dither, \
- dither); \
+ tmp_rand = gst_fast_random_double_range (- dither, dither); \
rand = tmp_rand - last_random[chan_pos]; \
last_random[chan_pos] = tmp_rand; \
tmp += rand;
@@ -430,7 +428,6 @@
default:
break;
}
- return;
g_free (ctx->error_buf);
ctx->error_buf = NULL;
@@ -446,16 +443,13 @@
ctx->last_random = g_new0 (gint32, ctx->out.channels);
else
ctx->last_random = g_new0 (gdouble, ctx->out.channels);
- ctx->dither_random = g_rand_new ();
break;
case DITHER_RPDF:
case DITHER_TPDF:
- ctx->dither_random = g_rand_new ();
ctx->last_random = NULL;
break;
case DITHER_NONE:
default:
- ctx->dither_random = NULL;
ctx->last_random = NULL;
break;
}
@@ -466,8 +460,6 @@
gst_audio_quantize_free_dither (AudioConvertCtx * ctx)
{
g_free (ctx->last_random);
- if (ctx->dither_random)
- g_rand_free (ctx->dither_random);
return;
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioconvert/gstchannelmix.c
--- a/gst_plugins_base/gst/audioconvert/gstchannelmix.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/audioconvert/gstchannelmix.c Wed Mar 24 18:04:17 2010 -0500
@@ -1,5 +1,6 @@
/* GStreamer
* Copyright (C) 2004 Ronald Bultje
+ * Copyright (C) 2008 Sebastian Dröge
*
* gstchannelmix.c: setup of channel conversion matrices
*
@@ -114,53 +115,64 @@
};
gint c;
- /* conversions from compatible (but not the same) channel schemes. This
- * goes two ways: if the sink has both pos1[0,1] and src has pos2[0] or
- * if the src has both pos1[0,1] and sink has pos2[0], then we do the
- * conversion. We hereby assume that the existance of pos1[0,1] and
- * pos2[0] are mututally exclusive. There are no checks for that,
- * unfortunately. This shouldn't lead to issues (like crashes or so),
- * though. */
+ /* conversions from compatible (but not the same) channel schemes */
for (c = 0; conv[c].pos1[0] != GST_AUDIO_CHANNEL_POSITION_INVALID; c++) {
- gint pos1_0 = -1, pos1_1 = -1, pos2_0 = -1, n;
+ gint pos1_0 = -1, pos1_1 = -1, pos1_2 = -1;
+ gint pos2_0 = -1, pos2_1 = -1, pos2_2 = -1;
+ gint n;
- /* Try to go from the given 2 channels to the given 1 channel */
for (n = 0; n < this->in.channels; n++) {
if (this->in.pos[n] == conv[c].pos1[0])
pos1_0 = n;
else if (this->in.pos[n] == conv[c].pos1[1])
pos1_1 = n;
+ else if (this->in.pos[n] == conv[c].pos2[0])
+ pos1_2 = n;
}
for (n = 0; n < this->out.channels; n++) {
- if (this->out.pos[n] == conv[c].pos2[0])
+ if (this->out.pos[n] == conv[c].pos1[0])
pos2_0 = n;
- }
-
- if (pos1_0 != -1 && pos1_1 != -1 && pos2_0 != -1) {
- this->matrix[pos1_0][pos2_0] = 1.0;
- this->matrix[pos1_1][pos2_0] = 1.0;
+ else if (this->out.pos[n] == conv[c].pos1[1])
+ pos2_1 = n;
+ else if (this->out.pos[n] == conv[c].pos2[0])
+ pos2_2 = n;
}
- /* Try to go from the given 1 channel to the given 2 channels */
- pos1_0 = -1;
- pos1_1 = -1;
- pos2_0 = -1;
+ /* The general idea here is to fill in channels from the same position
+ * as good as possible. This means mixing left<->center and right<->center.
+ */
+
+ /* left -> center */
+ if (pos1_0 != -1 && pos1_2 == -1 && pos2_0 == -1 && pos2_2 != -1)
+ this->matrix[pos1_0][pos2_2] = 1.0;
+ else if (pos1_0 != -1 && pos1_2 != -1 && pos2_0 == -1 && pos2_2 != -1)
+ this->matrix[pos1_0][pos2_2] = 0.5;
+ else if (pos1_0 != -1 && pos1_2 == -1 && pos2_0 != -1 && pos2_2 != -1)
+ this->matrix[pos1_0][pos2_2] = 1.0;
- for (n = 0; n < this->out.channels; n++) {
- if (this->out.pos[n] == conv[c].pos1[0])
- pos1_0 = n;
- else if (this->out.pos[n] == conv[c].pos1[1])
- pos1_1 = n;
- }
- for (n = 0; n < this->in.channels; n++) {
- if (this->in.pos[n] == conv[c].pos2[0])
- pos2_0 = n;
- }
+ /* right -> center */
+ if (pos1_1 != -1 && pos1_2 == -1 && pos2_1 == -1 && pos2_2 != -1)
+ this->matrix[pos1_1][pos2_2] = 1.0;
+ else if (pos1_1 != -1 && pos1_2 != -1 && pos2_1 == -1 && pos2_2 != -1)
+ this->matrix[pos1_1][pos2_2] = 0.5;
+ else if (pos1_1 != -1 && pos1_2 == -1 && pos2_1 != -1 && pos2_2 != -1)
+ this->matrix[pos1_1][pos2_2] = 1.0;
- if (pos1_0 != -1 && pos1_1 != -1 && pos2_0 != -1) {
- this->matrix[pos2_0][pos1_0] = 1.0;
- this->matrix[pos2_0][pos1_1] = 1.0;
- }
+ /* center -> left */
+ if (pos1_2 != -1 && pos1_0 == -1 && pos2_2 == -1 && pos2_0 != -1)
+ this->matrix[pos1_2][pos2_0] = 1.0;
+ else if (pos1_2 != -1 && pos1_0 != -1 && pos2_2 == -1 && pos2_0 != -1)
+ this->matrix[pos1_2][pos2_0] = 0.5;
+ else if (pos1_2 != -1 && pos1_0 == -1 && pos2_2 != -1 && pos2_0 != -1)
+ this->matrix[pos1_2][pos2_0] = 1.0;
+
+ /* center -> right */
+ if (pos1_2 != -1 && pos1_1 == -1 && pos2_2 == -1 && pos2_1 != -1)
+ this->matrix[pos1_2][pos2_1] = 1.0;
+ else if (pos1_2 != -1 && pos1_1 != -1 && pos2_2 == -1 && pos2_1 != -1)
+ this->matrix[pos1_2][pos2_1] = 0.5;
+ else if (pos1_2 != -1 && pos1_1 == -1 && pos2_2 != -1 && pos2_1 != -1)
+ this->matrix[pos1_2][pos2_1] = 1.0;
}
}
@@ -184,43 +196,52 @@
for (n = 0; n < caps->channels; n++) {
switch (caps->pos[n]) {
case GST_AUDIO_CHANNEL_POSITION_FRONT_MONO:
- case GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT:
- case GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT:
+ f[1] = n;
*has_f = TRUE;
- if (f[0] == -1)
- f[0] = n;
- else
- f[1] = n;
+ break;
+ case GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT:
+ f[0] = n;
+ *has_f = TRUE;
+ break;
+ case GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT:
+ f[2] = n;
+ *has_f = TRUE;
break;
case GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER:
- case GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER:
- case GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER:
+ c[1] = n;
*has_c = TRUE;
- if (c[0] == -1)
- c[0] = n;
- else
- c[1] = n;
+ break;
+ case GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER:
+ c[0] = n;
+ *has_c = TRUE;
+ break;
+ case GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER:
+ c[2] = n;
+ *has_c = TRUE;
break;
case GST_AUDIO_CHANNEL_POSITION_REAR_CENTER:
- case GST_AUDIO_CHANNEL_POSITION_REAR_LEFT:
- case GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT:
+ r[1] = n;
*has_r = TRUE;
- if (r[0] == -1)
- r[0] = n;
- else
- r[1] = n;
+ break;
+ case GST_AUDIO_CHANNEL_POSITION_REAR_LEFT:
+ r[0] = n;
+ *has_r = TRUE;
+ break;
+ case GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT:
+ r[2] = n;
+ *has_r = TRUE;
break;
case GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT:
- case GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT:
+ s[0] = n;
*has_s = TRUE;
- if (s[0] == -1)
- s[0] = n;
- else
- s[1] = n;
+ break;
+ case GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT:
+ s[2] = n;
+ *has_s = TRUE;
break;
case GST_AUDIO_CHANNEL_POSITION_LFE:
*has_b = TRUE;
- b[0] = n;
+ b[1] = n;
break;
default:
break;
@@ -231,55 +252,69 @@
static void
gst_channel_mix_fill_one_other (gfloat ** matrix,
AudioConvertFmt * from_caps, gint * from_idx,
- GstAudioChannelPosition from_pos_l,
- GstAudioChannelPosition from_pos_r,
- GstAudioChannelPosition from_pos_c,
- AudioConvertFmt * to_caps, gint * to_idx,
- GstAudioChannelPosition to_pos_l,
- GstAudioChannelPosition to_pos_r,
- GstAudioChannelPosition to_pos_c, gfloat ratio)
+ AudioConvertFmt * to_caps, gint * to_idx, gfloat ratio)
{
- gfloat in_r, out_r[2] = { 0.f, 0.f };
+
+ /* src & dst have center => passthrough */
+ if (from_idx[1] != -1 && to_idx[1] != -1) {
+ matrix[from_idx[1]][to_idx[1]] = ratio;
+ }
- /*
- * The idea is that we add up from the input (which means that if we
- * have stereo input, we divide their sum by two) and put that in
- * the matrix for their output ratio (given in $ratio).
- * For left channels, we need to invert the signal sign (* -1).
- */
+ /* src & dst have left => passthrough */
+ if (from_idx[0] != -1 && to_idx[0] != -1) {
+ matrix[from_idx[0]][to_idx[0]] = ratio;
+ }
- if (from_caps->pos[from_idx[0]] == from_pos_c)
- in_r = 1.0;
- else
- in_r = 0.5;
-
- if (to_caps->pos[to_idx[0]] == to_pos_l)
- out_r[0] = in_r * -ratio;
- else
- out_r[0] = in_r * ratio;
-
- if (to_idx[1] != -1) {
- if (to_caps->pos[to_idx[1]] == to_pos_l)
- out_r[1] = in_r * -ratio;
- else
- out_r[1] = in_r * ratio;
+ /* src & dst have right => passthrough */
+ if (from_idx[2] != -1 && to_idx[2] != -1) {
+ matrix[from_idx[2]][to_idx[2]] = ratio;
}
- matrix[from_idx[0]][to_idx[0]] = out_r[0];
- if (to_idx[1] != -1)
- matrix[from_idx[0]][to_idx[1]] = out_r[1];
- if (from_idx[1] != -1) {
- matrix[from_idx[1]][to_idx[0]] = out_r[0];
- if (to_idx[1] != -1)
- matrix[from_idx[1]][to_idx[1]] = out_r[1];
+ /* src has left & dst has center => put into center */
+ if (from_idx[0] != -1 && to_idx[1] != -1 && from_idx[1] != -1) {
+ matrix[from_idx[0]][to_idx[1]] = 0.5 * ratio;
+ } else if (from_idx[0] != -1 && to_idx[1] != -1 && from_idx[1] == -1) {
+ matrix[from_idx[0]][to_idx[1]] = ratio;
+ }
+
+ /* src has right & dst has center => put into center */
+ if (from_idx[2] != -1 && to_idx[1] != -1 && from_idx[1] != -1) {
+ matrix[from_idx[2]][to_idx[1]] = 0.5 * ratio;
+ } else if (from_idx[2] != -1 && to_idx[1] != -1 && from_idx[1] == -1) {
+ matrix[from_idx[2]][to_idx[1]] = ratio;
+ }
+
+ /* src has center & dst has left => passthrough */
+ if (from_idx[1] != -1 && to_idx[0] != -1 && from_idx[0] != -1) {
+ matrix[from_idx[1]][to_idx[0]] = 0.5 * ratio;
+ } else if (from_idx[1] != -1 && to_idx[0] != -1 && from_idx[0] == -1) {
+ matrix[from_idx[1]][to_idx[0]] = ratio;
+ }
+
+ /* src has center & dst has right => passthrough */
+ if (from_idx[1] != -1 && to_idx[2] != -1 && from_idx[2] != -1) {
+ matrix[from_idx[1]][to_idx[2]] = 0.5 * ratio;
+ } else if (from_idx[1] != -1 && to_idx[2] != -1 && from_idx[2] == -1) {
+ matrix[from_idx[1]][to_idx[2]] = ratio;
}
}
+#define RATIO_CENTER_FRONT (1.0 / sqrt (2.0))
+#define RATIO_CENTER_SIDE (1.0 / 2.0)
+#define RATIO_CENTER_REAR (1.0 / sqrt (8.0))
+
#define RATIO_FRONT_CENTER (1.0 / sqrt (2.0))
-#define RATIO_FRONT_REAR (1.0 / sqrt (2.0))
+#define RATIO_FRONT_SIDE (1.0 / sqrt (2.0))
+#define RATIO_FRONT_REAR (1.0 / 2.0)
+
+#define RATIO_SIDE_CENTER (1.0 / 2.0)
+#define RATIO_SIDE_FRONT (1.0 / sqrt (2.0))
+#define RATIO_SIDE_REAR (1.0 / sqrt (2.0))
+
+#define RATIO_CENTER_BASS (1.0 / sqrt (2.0))
#define RATIO_FRONT_BASS (1.0)
+#define RATIO_SIDE_BASS (1.0 / sqrt (2.0))
#define RATIO_REAR_BASS (1.0 / sqrt (2.0))
-#define RATIO_CENTER_BASS (1.0 / sqrt (2.0))
static void
gst_channel_mix_fill_others (AudioConvertCtx * this)
@@ -289,16 +324,21 @@
in_has_rear = FALSE, out_has_rear = FALSE,
in_has_side = FALSE, out_has_side = FALSE,
in_has_bass = FALSE, out_has_bass = FALSE;
- gint in_f[2] = { -1, -1 }, out_f[2] = {
- -1, -1}, in_c[2] = {
- -1, -1}, out_c[2] = {
- -1, -1}, in_r[2] = {
- -1, -1}, out_r[2] = {
- -1, -1}, in_s[2] = {
- -1, -1}, out_s[2] = {
- -1, -1}, in_b[2] = {
- -1, -1}, out_b[2] = {
- -1, -1};
+ /* LEFT, RIGHT, MONO */
+ gint in_f[3] = { -1, -1, -1 };
+ gint out_f[3] = { -1, -1, -1 };
+ /* LOC, ROC, CENTER */
+ gint in_c[3] = { -1, -1, -1 };
+ gint out_c[3] = { -1, -1, -1 };
+ /* RLEFT, RRIGHT, RCENTER */
+ gint in_r[3] = { -1, -1, -1 };
+ gint out_r[3] = { -1, -1, -1 };
+ /* SLEFT, INVALID, SRIGHT */
+ gint in_s[3] = { -1, -1, -1 };
+ gint out_s[3] = { -1, -1, -1 };
+ /* INVALID, LFE, INVALID */
+ gint in_b[3] = { -1, -1, -1 };
+ gint out_b[3] = { -1, -1, -1 };
/* First see where (if at all) the various channels from/to
* which we want to convert are located in our matrix/array. */
@@ -311,124 +351,164 @@
out_c, &out_has_center, out_r, &out_has_rear,
out_s, &out_has_side, out_b, &out_has_bass);
- /* center/front */
+ /* The general idea here is:
+ * - if the source has a channel that the destination doesn't have mix
+ * it into the nearest available destination channel
+ * - if the destination has a channel that the source doesn't have mix
+ * the nearest source channel into the destination channel
+ *
+ * The ratio for the mixing becomes lower as the distance between the
+ * channels gets larger
+ */
+
+ /* center <-> front/side/rear */
if (!in_has_center && in_has_front && out_has_center) {
gst_channel_mix_fill_one_other (this->matrix,
- &this->in, in_f,
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_MONO,
- &this->out, out_c,
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
- GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, RATIO_FRONT_CENTER);
+ &this->in, in_f, &this->out, out_c, RATIO_CENTER_FRONT);
+ } else if (!in_has_center && !in_has_front && in_has_side && out_has_center) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_s, &this->out, out_c, RATIO_CENTER_SIDE);
+ } else if (!in_has_center && !in_has_front && !in_has_side && in_has_rear
+ && out_has_center) {
+ gst_channel_mix_fill_one_other (this->matrix, &this->in, in_r, &this->out,
+ out_c, RATIO_CENTER_REAR);
} else if (in_has_center && !out_has_center && out_has_front) {
gst_channel_mix_fill_one_other (this->matrix,
- &this->in, in_c,
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
- GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
- &this->out, out_f,
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_MONO, RATIO_FRONT_CENTER);
+ &this->in, in_c, &this->out, out_f, RATIO_CENTER_FRONT);
+ } else if (in_has_center && !out_has_center && !out_has_front && out_has_side) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_c, &this->out, out_s, RATIO_CENTER_SIDE);
+ } else if (in_has_center && !out_has_center && !out_has_front && !out_has_side
+ && out_has_rear) {
+ gst_channel_mix_fill_one_other (this->matrix, &this->in, in_c, &this->out,
+ out_r, RATIO_CENTER_REAR);
+ }
+
+ /* front <-> center/side/rear */
+ if (!in_has_front && in_has_center && !in_has_side && out_has_front) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_c, &this->out, out_f, RATIO_CENTER_FRONT);
+ } else if (!in_has_front && !in_has_center && in_has_side && out_has_front) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_s, &this->out, out_f, RATIO_FRONT_SIDE);
+ } else if (!in_has_front && in_has_center && in_has_side && out_has_front) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_c, &this->out, out_f, 0.5 * RATIO_CENTER_FRONT);
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_s, &this->out, out_f, 0.5 * RATIO_FRONT_SIDE);
+ } else if (!in_has_front && !in_has_center && !in_has_side && in_has_rear
+ && out_has_front) {
+ gst_channel_mix_fill_one_other (this->matrix, &this->in, in_r, &this->out,
+ out_f, RATIO_FRONT_REAR);
+ } else if (in_has_front && out_has_center && !out_has_side && !out_has_front) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_f, &this->out, out_c, RATIO_CENTER_FRONT);
+ } else if (in_has_front && !out_has_center && out_has_side && !out_has_front) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_f, &this->out, out_s, RATIO_FRONT_SIDE);
+ } else if (in_has_front && out_has_center && out_has_side && !out_has_front) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_f, &this->out, out_c, 0.5 * RATIO_CENTER_FRONT);
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_f, &this->out, out_s, 0.5 * RATIO_FRONT_SIDE);
+ } else if (in_has_front && !out_has_center && !out_has_side && !out_has_front
+ && out_has_rear) {
+ gst_channel_mix_fill_one_other (this->matrix, &this->in, in_f, &this->out,
+ out_r, RATIO_FRONT_REAR);
}
- /* rear/front */
- if (!in_has_rear && in_has_front && out_has_rear) {
+ /* side <-> center/front/rear */
+ if (!in_has_side && in_has_front && !in_has_rear && out_has_side) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_f, &this->out, out_s, RATIO_FRONT_SIDE);
+ } else if (!in_has_side && !in_has_front && in_has_rear && out_has_side) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_r, &this->out, out_s, RATIO_SIDE_REAR);
+ } else if (!in_has_side && in_has_front && in_has_rear && out_has_side) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_f, &this->out, out_s, 0.5 * RATIO_FRONT_SIDE);
gst_channel_mix_fill_one_other (this->matrix,
- &this->in, in_f,
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_MONO,
- &this->out, out_r,
- GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
- GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
- GST_AUDIO_CHANNEL_POSITION_REAR_CENTER, RATIO_FRONT_REAR);
- } else if (in_has_rear && !out_has_rear && out_has_front) {
+ &this->in, in_r, &this->out, out_s, 0.5 * RATIO_SIDE_REAR);
+ } else if (!in_has_side && !in_has_front && !in_has_rear && in_has_center
+ && out_has_side) {
+ gst_channel_mix_fill_one_other (this->matrix, &this->in, in_c, &this->out,
+ out_s, RATIO_CENTER_SIDE);
+ } else if (in_has_side && out_has_front && !out_has_rear && !out_has_side) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_s, &this->out, out_f, RATIO_FRONT_SIDE);
+ } else if (in_has_side && !out_has_front && out_has_rear && !out_has_side) {
gst_channel_mix_fill_one_other (this->matrix,
- &this->in, in_r,
- GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
- GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
- GST_AUDIO_CHANNEL_POSITION_REAR_CENTER,
- &this->out, out_f,
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_MONO, RATIO_FRONT_REAR);
+ &this->in, in_s, &this->out, out_r, RATIO_SIDE_REAR);
+ } else if (in_has_side && out_has_front && out_has_rear && !out_has_side) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_s, &this->out, out_f, 0.5 * RATIO_FRONT_SIDE);
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_s, &this->out, out_r, 0.5 * RATIO_SIDE_REAR);
+ } else if (in_has_side && !out_has_front && !out_has_rear && out_has_center
+ && !out_has_side) {
+ gst_channel_mix_fill_one_other (this->matrix, &this->in, in_s, &this->out,
+ out_c, RATIO_CENTER_SIDE);
}
- /* bass/any */
+ /* rear <-> center/front/side */
+ if (!in_has_rear && in_has_side && out_has_rear) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_s, &this->out, out_r, RATIO_SIDE_REAR);
+ } else if (!in_has_rear && !in_has_side && in_has_front && out_has_rear) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_f, &this->out, out_r, RATIO_FRONT_REAR);
+ } else if (!in_has_rear && !in_has_side && !in_has_front && in_has_center
+ && out_has_rear) {
+ gst_channel_mix_fill_one_other (this->matrix, &this->in, in_c, &this->out,
+ out_r, RATIO_CENTER_REAR);
+ } else if (in_has_rear && !out_has_rear && out_has_side) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_r, &this->out, out_s, RATIO_SIDE_REAR);
+ } else if (in_has_rear && !out_has_rear && !out_has_side && out_has_front) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_r, &this->out, out_f, RATIO_FRONT_REAR);
+ } else if (in_has_rear && !out_has_rear && !out_has_side && !out_has_front
+ && out_has_center) {
+ gst_channel_mix_fill_one_other (this->matrix, &this->in, in_r, &this->out,
+ out_c, RATIO_CENTER_REAR);
+ }
+
+ /* bass <-> any */
if (in_has_bass && !out_has_bass) {
+ if (out_has_center) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_b, &this->out, out_c, RATIO_CENTER_BASS);
+ }
if (out_has_front) {
gst_channel_mix_fill_one_other (this->matrix,
- &this->in, in_b,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_LFE,
- &this->out, out_f,
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_MONO, RATIO_FRONT_BASS);
+ &this->in, in_b, &this->out, out_f, RATIO_FRONT_BASS);
}
- if (out_has_center) {
+ if (out_has_side) {
gst_channel_mix_fill_one_other (this->matrix,
- &this->in, in_b,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_LFE,
- &this->out, out_c,
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
- GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER, RATIO_CENTER_BASS);
+ &this->in, in_b, &this->out, out_s, RATIO_SIDE_BASS);
}
if (out_has_rear) {
gst_channel_mix_fill_one_other (this->matrix,
- &this->in, in_b,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_LFE,
- &this->out, out_r,
- GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
- GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
- GST_AUDIO_CHANNEL_POSITION_REAR_CENTER, RATIO_REAR_BASS);
+ &this->in, in_b, &this->out, out_r, RATIO_REAR_BASS);
}
} else if (!in_has_bass && out_has_bass) {
+ if (in_has_center) {
+ gst_channel_mix_fill_one_other (this->matrix,
+ &this->in, in_c, &this->out, out_b, RATIO_CENTER_BASS);
+ }
if (in_has_front) {
gst_channel_mix_fill_one_other (this->matrix,
- &this->in, in_f,
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
- GST_AUDIO_CHANNEL_POSITION_FRONT_MONO,
- &this->out, out_b,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_LFE, RATIO_FRONT_BASS);
+ &this->in, in_f, &this->out, out_b, RATIO_FRONT_BASS);
}
- if (in_has_center) {
+ if (in_has_side) {
gst_channel_mix_fill_one_other (this->matrix,
- &this->in, in_c,
- GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
- GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
- GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
- &this->out, out_b,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_LFE, RATIO_CENTER_BASS);
+ &this->in, in_s, &this->out, out_b, RATIO_REAR_BASS);
}
if (in_has_rear) {
gst_channel_mix_fill_one_other (this->matrix,
- &this->in, in_r,
- GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
- GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
- GST_AUDIO_CHANNEL_POSITION_REAR_CENTER,
- &this->out, out_b,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_INVALID,
- GST_AUDIO_CHANNEL_POSITION_LFE, RATIO_REAR_BASS);
+ &this->in, in_r, &this->out, out_b, RATIO_REAR_BASS);
}
}
-
- /* FIXME: side */
}
/*
@@ -453,6 +533,9 @@
}
/* normalize to this */
+ if (top == 0.0)
+ return;
+
for (j = 0; j < this->out.channels; j++) {
for (i = 0; i < this->in.channels; i++) {
this->matrix[i][j] /= top;
@@ -460,6 +543,39 @@
}
}
+static gboolean
+gst_channel_mix_fill_special (AudioConvertCtx * this)
+{
+ AudioConvertFmt *in = &this->in, *out = &this->out;
+
+ /* Special, standard conversions here */
+
+ /* Mono<->Stereo, just a fast-path */
+ if (in->channels == 2 && out->channels == 1 &&
+ ((in->pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT &&
+ in->pos[1] == GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT) ||
+ (in->pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT &&
+ in->pos[1] == GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT)) &&
+ out->pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_MONO) {
+ this->matrix[0][0] = 0.5;
+ this->matrix[1][0] = 0.5;
+ return TRUE;
+ } else if (in->channels == 1 && out->channels == 2 &&
+ ((out->pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT &&
+ out->pos[1] == GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT) ||
+ (out->pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT &&
+ out->pos[1] == GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT)) &&
+ in->pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_MONO) {
+ this->matrix[0][0] = 1.0;
+ this->matrix[0][1] = 1.0;
+ return TRUE;
+ }
+
+ /* TODO: 5.1 <-> Stereo and other standard conversions */
+
+ return FALSE;
+}
+
/*
* Automagically generate conversion matrix.
*/
@@ -467,10 +583,16 @@
static void
gst_channel_mix_fill_matrix (AudioConvertCtx * this)
{
+ if (gst_channel_mix_fill_special (this))
+ return;
+
gst_channel_mix_fill_identical (this);
- gst_channel_mix_fill_compatible (this);
- gst_channel_mix_fill_others (this);
- gst_channel_mix_fill_normalize (this);
+
+ if (!this->in.unpositioned_layout) {
+ gst_channel_mix_fill_compatible (this);
+ gst_channel_mix_fill_others (this);
+ gst_channel_mix_fill_normalize (this);
+ }
}
/* only call after this->out and this->in are filled in */
@@ -482,7 +604,6 @@
gst_channel_mix_setup_matrix (AudioConvertCtx * this)
{
gint i, j;
- GString *s;
/* don't lose memory */
gst_channel_mix_unset_matrix (this);
@@ -505,25 +626,30 @@
/* setup the matrix' internal values */
gst_channel_mix_fill_matrix (this);
+#ifndef GST_DISABLE_GST_DEBUG
/* debug */
- s = g_string_new ("Matrix for");
- g_string_append_printf (s, " %d -> %d: ",
- this->in.channels, this->out.channels);
- g_string_append (s, "{");
- for (i = 0; i < this->in.channels; i++) {
- if (i != 0)
- g_string_append (s, ",");
- g_string_append (s, " {");
- for (j = 0; j < this->out.channels; j++) {
- if (j != 0)
+ {
+ GString *s;
+ s = g_string_new ("Matrix for");
+ g_string_append_printf (s, " %d -> %d: ",
+ this->in.channels, this->out.channels);
+ g_string_append (s, "{");
+ for (i = 0; i < this->in.channels; i++) {
+ if (i != 0)
g_string_append (s, ",");
- g_string_append_printf (s, " %f", this->matrix[i][j]);
+ g_string_append (s, " {");
+ for (j = 0; j < this->out.channels; j++) {
+ if (j != 0)
+ g_string_append (s, ",");
+ g_string_append_printf (s, " %f", this->matrix[i][j]);
+ }
+ g_string_append (s, " }");
}
g_string_append (s, " }");
+ GST_DEBUG (s->str);
+ g_string_free (s, TRUE);
}
- g_string_append (s, " }");
- GST_DEBUG (s->str);
- g_string_free (s, TRUE);
+#endif
}
#ifdef __SYMBIAN32__
EXPORT_C
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioconvert/gstfastrandom.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst/audioconvert/gstfastrandom.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,90 @@
+/* GStreamer
+ * Copyright (C) 2008 Sebastian Dröge
+ *
+ * gstfastrandom.h: Fast, bad PNRG
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include
+
+#ifndef __GST_FAST_RANDOM__
+#define __GST_FAST_RANDOM__
+
+/* transform [0..2^32] -> [0..1] */
+#define GST_RAND_DOUBLE_TRANSFORM 2.3283064365386962890625e-10
+
+/* This is the base function, implementing a linear congruential generator
+ * and returning a pseudo random number between 0 and 2^32 - 1.
+ */
+static inline guint32
+gst_fast_random_uint32 ()
+{
+ static guint32 state = 0xdeadbeef;
+
+ return (state = state * 1103515245 + 12345);
+}
+
+static inline guint32
+gst_fast_random_uint32_range (gint32 start, gint32 end)
+{
+ guint64 tmp = gst_fast_random_uint32 ();
+
+ tmp = (tmp * (end - start)) / G_MAXUINT32 + start;
+
+ return (guint32) tmp;
+}
+
+static inline gint32
+gst_fast_random_int32 (void)
+{
+ return (gint32) gst_fast_random_uint32 ();
+}
+
+static inline gint32
+gst_fast_random_int32_range (gint32 start, gint32 end)
+{
+ gint64 tmp = gst_fast_random_uint32 ();
+
+ tmp = (tmp * (end - start)) / G_MAXUINT32 + start;
+
+ return (gint32) tmp;
+}
+
+static inline gdouble
+gst_fast_random_double (void)
+{
+ gdouble ret;
+
+ ret = gst_fast_random_uint32 () * GST_RAND_DOUBLE_TRANSFORM;
+ ret = (ret + gst_fast_random_uint32 ()) * GST_RAND_DOUBLE_TRANSFORM;
+
+ if (ret >= 1.0)
+ return gst_fast_random_double ();
+
+ return ret;
+}
+
+static inline gdouble
+gst_fast_random_double_range (gdouble start, gdouble end)
+{
+ return gst_fast_random_double () * (end - start) + start;
+}
+
+#undef GST_RAND_DOUBLE_TRANSFORM
+
+#endif /* __GST_FAST_RANDOM__ */
+
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audiorate/gstaudiorate.c
--- a/gst_plugins_base/gst/audiorate/gstaudiorate.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/audiorate/gstaudiorate.c Wed Mar 24 18:04:17 2010 -0500
@@ -141,7 +141,6 @@
EXPORT_C
#endif
-
static GType
gst_audio_rate_get_type (void)
{
@@ -192,20 +191,21 @@
g_object_class_install_property (object_class, ARG_IN,
g_param_spec_uint64 ("in", "In",
- "Number of input samples", 0, G_MAXUINT64, 0, G_PARAM_READABLE));
+ "Number of input samples", 0, G_MAXUINT64, 0,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, ARG_OUT,
- g_param_spec_uint64 ("out", "Out",
- "Number of output samples", 0, G_MAXUINT64, 0, G_PARAM_READABLE));
+ g_param_spec_uint64 ("out", "Out", "Number of output samples", 0,
+ G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, ARG_ADD,
- g_param_spec_uint64 ("add", "Add",
- "Number of added samples", 0, G_MAXUINT64, 0, G_PARAM_READABLE));
+ g_param_spec_uint64 ("add", "Add", "Number of added samples", 0,
+ G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, ARG_DROP,
- g_param_spec_uint64 ("drop", "Drop",
- "Number of dropped samples", 0, G_MAXUINT64, 0, G_PARAM_READABLE));
+ g_param_spec_uint64 ("drop", "Drop", "Number of dropped samples", 0,
+ G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, ARG_SILENT,
g_param_spec_boolean ("silent", "silent",
- "Don't emit notify for dropped and duplicated frames",
- DEFAULT_SILENT, G_PARAM_READWRITE));
+ "Don't emit notify for dropped and duplicated frames", DEFAULT_SILENT,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
element_class->change_state = gst_audio_rate_change_state;
}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/README
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst/audioresample/README Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,336 @@
+ arch.h
+ fixed_arm4.h
+ fixed_arm5e.h
+ fixed_bfin.h
+ fixed_debug.h
+ fixed_generic.h
+ resample.c
+ speex_resampler.h
+
+are taken from http://git.xiph.org/speex.git/ as of 2008-10-28.
+
+The only changes are:
+
+--- arch.h 2008-11-28 09:57:15.000000000 +0100
++++ arch.h 2008-11-28 09:57:37.000000000 +0100
+@@ -78,7 +78,10 @@
+ #include "../include/speex/speex_types.h"
+ #endif
+
++#ifndef ABS
+ #define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */
++#endif
++
+ #define ABS16(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 16-bit value. */
+ #define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 16-bit value. */
+ #define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */
+@@ -134,6 +137,28 @@
+
+ #else
+
++#ifdef DOUBLE_PRECISION
++typedef double spx_mem_t;
++typedef double spx_coef_t;
++typedef double spx_lsp_t;
++typedef double spx_sig_t;
++typedef double spx_word16_t;
++typedef double spx_word32_t;
++
++#define Q15ONE 1.0
++#define LPC_SCALING 1.
++#define SIG_SCALING 1.
++#define LSP_SCALING 1.
++#define GAMMA_SCALING 1.
++#define GAIN_SCALING 1.
++#define GAIN_SCALING_1 1.
++
++
++#define VERY_SMALL 1e-20
++#define VERY_LARGE32 1e20
++#define VERY_LARGE16 1e20
++#define Q15_ONE ((spx_word16_t)1.)
++#else /* !DOUBLE_PRECISION */
+ typedef float spx_mem_t;
+ typedef float spx_coef_t;
+ typedef float spx_lsp_t;
+@@ -154,6 +179,7 @@
+ #define VERY_LARGE32 1e15f
+ #define VERY_LARGE16 1e15f
+ #define Q15_ONE ((spx_word16_t)1.f)
++#endif /* DOUBLE_PRECISION */
+
+ #define QCONST16(x,bits) (x)
+ #define QCONST32(x,bits) (x)
+--- resample.c 2008-11-28 09:56:42.000000000 +0100
++++ resample.c 2008-11-01 20:38:35.000000000 +0100
+@@ -63,22 +63,27 @@
+
+ #ifdef OUTSIDE_SPEEX
+ #include
+-static void *
++
++#include
++
++#define EXPORT G_GNUC_INTERNAL
++
++static inline void *
+ speex_alloc (int size)
+ {
+- return calloc (size, 1);
++ return g_malloc0 (size);
+ }
+
+-static void *
++static inline void *
+ speex_realloc (void *ptr, int size)
+ {
+- return realloc (ptr, size);
++ return g_realloc (ptr, size);
+ }
+
+-static void
++static inline void
+ speex_free (void *ptr)
+ {
+- free (ptr);
++ g_free (ptr);
+ }
+
+ #include "speex_resampler.h"
+@@ -90,7 +95,6 @@
+ #include "os_support.h"
+ #endif /* OUTSIDE_SPEEX */
+
+-#include "stack_alloc.h"
+ #include
+
+ #ifndef M_PI
+@@ -263,10 +267,17 @@
+ };
+
+ /*8,24,40,56,80,104,128,160,200,256,320*/
++#ifdef DOUBLE_PRECISION
++static double
++compute_func (double x, struct FuncDef *func)
++{
++ double y, frac;
++#else
+ static double
+ compute_func (float x, struct FuncDef *func)
+ {
+ float y, frac;
++#endif
+ double interp[4];
+ int ind;
+ y = x * func->oversample;
+@@ -317,11 +328,19 @@
+ }
+ #else
+ /* The slow way of computing a sinc for the table. Should improve that some day */
++#ifdef DOUBLE_PRECISION
++static spx_word16_t
++sinc (double cutoff, double x, int N, struct FuncDef *window_func)
++{
++ /*fprintf (stderr, "%f ", x); */
++ double xx = x * cutoff;
++#else
+ static spx_word16_t
+ sinc (float cutoff, float x, int N, struct FuncDef *window_func)
+ {
+ /*fprintf (stderr, "%f ", x); */
+ float xx = x * cutoff;
++#endif
+ if (fabs (x) < 1e-6)
+ return cutoff;
+ else if (fabs (x) > .5 * N)
+@@ -372,6 +391,7 @@
+ }
+ #endif
+
++#ifndef DOUBLE_PRECISION
+ static int
+ resampler_basic_direct_single (SpeexResamplerState * st,
+ spx_uint32_t channel_index, const spx_word16_t * in, spx_uint32_t * in_len,
+@@ -421,6 +441,7 @@
+ st->samp_frac_num[channel_index] = samp_frac_num;
+ return out_sample;
+ }
++#endif
+
+ #ifdef FIXED_POINT
+ #else
+@@ -476,6 +497,7 @@
+ }
+ #endif
+
++#ifndef DOUBLE_PRECISION
+ static int
+ resampler_basic_interpolate_single (SpeexResamplerState * st,
+ spx_uint32_t channel_index, const spx_word16_t * in, spx_uint32_t * in_len,
+@@ -554,6 +576,7 @@
+ st->samp_frac_num[channel_index] = samp_frac_num;
+ return out_sample;
+ }
++#endif
+
+ #ifdef FIXED_POINT
+ #else
+@@ -584,10 +607,16 @@
+ PDIV32 (SHL32 ((samp_frac_num * st->oversample) % st->den_rate, 15),
+ st->den_rate);
+ #else
++#ifdef DOUBLE_PRECISION
++ const spx_word16_t frac =
++ ((double) ((samp_frac_num * st->oversample) % st->den_rate)) /
++ st->den_rate;
++#else
+ const spx_word16_t frac =
+ ((float) ((samp_frac_num * st->oversample) % st->den_rate)) /
+ st->den_rate;
+ #endif
++#endif
+ spx_word16_t interp[4];
+
+
+@@ -688,20 +717,27 @@
+ spx_int32_t j;
+ for (j = 0; j < st->filt_len; j++) {
+ st->sinc_table[i * st->filt_len + j] =
+- sinc (st->cutoff,
+- ((j - (spx_int32_t) st->filt_len / 2 + 1) -
++ sinc (st->cutoff, ((j - (spx_int32_t) st->filt_len / 2 + 1) -
++#ifdef DOUBLE_PRECISION
++ ((double) i) / st->den_rate), st->filt_len,
++#else
+ ((float) i) / st->den_rate), st->filt_len,
++#endif
+ quality_map[st->quality].window_func);
+ }
+ }
+ #ifdef FIXED_POINT
+ st->resampler_ptr = resampler_basic_direct_single;
+ #else
++#ifdef DOUBLE_PRECISION
++ st->resampler_ptr = resampler_basic_direct_double;
++#else
+ if (st->quality > 8)
+ st->resampler_ptr = resampler_basic_direct_double;
+ else
+ st->resampler_ptr = resampler_basic_direct_single;
+ #endif
++#endif
+ /*fprintf (stderr, "resampler uses direct sinc table and normalised cutoff %f\n", cutoff); */
+ } else {
+ spx_int32_t i;
+@@ -717,16 +753,24 @@
+ }
+ for (i = -4; i < (spx_int32_t) (st->oversample * st->filt_len + 4); i++)
+ st->sinc_table[i + 4] =
++#ifdef DOUBLE_PRECISION
++ sinc (st->cutoff, (i / (double) st->oversample - st->filt_len / 2),
++#else
+ sinc (st->cutoff, (i / (float) st->oversample - st->filt_len / 2),
++#endif
+ st->filt_len, quality_map[st->quality].window_func);
+ #ifdef FIXED_POINT
+ st->resampler_ptr = resampler_basic_interpolate_single;
+ #else
++#ifdef DOUBLE_PRECISION
++ st->resampler_ptr = resampler_basic_interpolate_double;
++#else
+ if (st->quality > 8)
+ st->resampler_ptr = resampler_basic_interpolate_double;
+ else
+ st->resampler_ptr = resampler_basic_interpolate_single;
+ #endif
++#endif
+ /*fprintf (stderr, "resampler uses interpolated sinc table and normalised cutoff %f\n", cutoff); */
+ }
+ st->int_advance = st->num_rate / st->den_rate;
+@@ -956,11 +1000,18 @@
+ spx_uint32_t channel_index, const spx_int16_t * in, spx_uint32_t * in_len,
+ spx_int16_t * out, spx_uint32_t * out_len)
+ #else
++#ifdef DOUBLE_PRECISION
++EXPORT int
++speex_resampler_process_float (SpeexResamplerState * st,
++ spx_uint32_t channel_index, const double *in, spx_uint32_t * in_len,
++ double *out, spx_uint32_t * out_len)
++#else
+ EXPORT int
+ speex_resampler_process_float (SpeexResamplerState * st,
+ spx_uint32_t channel_index, const float *in, spx_uint32_t * in_len,
+ float *out, spx_uint32_t * out_len)
+ #endif
++#endif
+ {
+ int j;
+ spx_uint32_t ilen = *in_len;
+@@ -1078,9 +1129,16 @@
+ return RESAMPLER_ERR_SUCCESS;
+ }
+
++#ifdef DOUBLE_PRECISION
++EXPORT int
++speex_resampler_process_interleaved_float (SpeexResamplerState * st,
++ const double *in, spx_uint32_t * in_len, double *out,
++ spx_uint32_t * out_len)
++#else
+ EXPORT int
+ speex_resampler_process_interleaved_float (SpeexResamplerState * st,
+ const float *in, spx_uint32_t * in_len, float *out, spx_uint32_t * out_len)
++#endif
+ {
+ spx_uint32_t i;
+ int istride_save, ostride_save;
+--- speex_resampler.h 2008-11-28 09:57:15.000000000 +0100
++++ speex_resampler.h 2008-11-28 09:57:37.000000000 +0100
+@@ -77,10 +77,10 @@
+ #define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem)
+ #define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerror)
+
+-#define spx_int16_t short
+-#define spx_int32_t int
+-#define spx_uint16_t unsigned short
+-#define spx_uint32_t unsigned int
++#define spx_int16_t gint16
++#define spx_int32_t gint32
++#define spx_uint16_t guint16
++#define spx_uint32_t guint32
+
+ #else /* OUTSIDE_SPEEX */
+
+@@ -162,10 +162,17 @@
+ * @param out Output buffer
+ * @param out_len Size of the output buffer. Returns the number of samples written
+ */
++#ifdef DOUBLE_PRECISION
++ int speex_resampler_process_float (SpeexResamplerState * st,
++ spx_uint32_t channel_index,
++ const double *in,
++ spx_uint32_t * in_len, double *out, spx_uint32_t * out_len);
++#else
+ int speex_resampler_process_float (SpeexResamplerState * st,
+ spx_uint32_t channel_index,
+ const float *in,
+ spx_uint32_t * in_len, float *out, spx_uint32_t * out_len);
++#endif
+
+ /** Resample an int array. The input and output buffers must *not* overlap.
+ * @param st Resampler state
+@@ -191,9 +198,15 @@
+ * @param out_len Size of the output buffer. Returns the number of samples written.
+ * This is all per-channel.
+ */
++#ifdef DOUBLE_PRECISION
++ int speex_resampler_process_interleaved_float (SpeexResamplerState * st,
++ const double *in,
++ spx_uint32_t * in_len, double *out, spx_uint32_t * out_len);
++#else
+ int speex_resampler_process_interleaved_float (SpeexResamplerState * st,
+ const float *in,
+ spx_uint32_t * in_len, float *out, spx_uint32_t * out_len);
++#endif
+
+ /** Resample an interleaved int array. The input and output buffers must *not* overlap.
+ * @param st Resampler state
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/arch_double.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst/audioresample/arch_double.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,265 @@
+/* Copyright (C) 2003 Jean-Marc Valin */
+/**
+ @file arch.h
+ @brief Various architecture definitions Speex
+*/
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef ARCH_H
+#define ARCH_H
+
+#ifndef SPEEX_VERSION
+#define SPEEX_MAJOR_VERSION 1 /**< Major Speex version. */
+#define SPEEX_MINOR_VERSION 1 /**< Minor Speex version. */
+#define SPEEX_MICRO_VERSION 15 /**< Micro Speex version. */
+#define SPEEX_EXTRA_VERSION "" /**< Extra Speex version. */
+#define SPEEX_VERSION "speex-1.2beta3" /**< Speex version string. */
+#endif
+
+/* A couple test to catch stupid option combinations */
+#ifdef FIXED_POINT
+
+#ifdef FLOATING_POINT
+#error You cannot compile as floating point and fixed point at the same time
+#endif
+#ifdef _USE_SSE
+#error SSE is only for floating-point
+#endif
+#if ((defined (ARM4_ASM)||defined (ARM4_ASM)) && defined(BFIN_ASM)) || (defined (ARM4_ASM)&&defined(ARM5E_ASM))
+#error Make up your mind. What CPU do you have?
+#endif
+#ifdef VORBIS_PSYCHO
+#error Vorbis-psy model currently not implemented in fixed-point
+#endif
+
+#else
+
+#ifndef FLOATING_POINT
+#error You now need to define either FIXED_POINT or FLOATING_POINT
+#endif
+#if defined (ARM4_ASM) || defined(ARM5E_ASM) || defined(BFIN_ASM)
+#error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
+#endif
+#ifdef FIXED_POINT_DEBUG
+#error "Don't you think enabling fixed-point is a good thing to do if you want to debug that?"
+#endif
+
+
+#endif
+
+#ifndef OUTSIDE_SPEEX
+#include "../include/speex/speex_types.h"
+#endif
+
+#ifndef ABS
+#define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */
+#endif
+
+#define ABS16(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 16-bit value. */
+#define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 16-bit value. */
+#define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */
+#define ABS32(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 32-bit value. */
+#define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 32-bit value. */
+#define MAX32(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 32-bit value. */
+
+#ifdef FIXED_POINT
+
+typedef spx_int16_t spx_word16_t;
+typedef spx_int32_t spx_word32_t;
+typedef spx_word32_t spx_mem_t;
+typedef spx_word16_t spx_coef_t;
+typedef spx_word16_t spx_lsp_t;
+typedef spx_word32_t spx_sig_t;
+
+#define Q15ONE 32767
+
+#define LPC_SCALING 8192
+#define SIG_SCALING 16384
+#define LSP_SCALING 8192.
+#define GAMMA_SCALING 32768.
+#define GAIN_SCALING 64
+#define GAIN_SCALING_1 0.015625
+
+#define LPC_SHIFT 13
+#define LSP_SHIFT 13
+#define SIG_SHIFT 14
+#define GAIN_SHIFT 6
+
+#define VERY_SMALL 0
+#define VERY_LARGE32 ((spx_word32_t)2147483647)
+#define VERY_LARGE16 ((spx_word16_t)32767)
+#define Q15_ONE ((spx_word16_t)32767)
+
+
+#ifdef FIXED_DEBUG
+#include "fixed_debug.h"
+#else
+
+#include "fixed_generic.h"
+
+#ifdef ARM5E_ASM
+#include "fixed_arm5e.h"
+#elif defined (ARM4_ASM)
+#include "fixed_arm4.h"
+#elif defined (BFIN_ASM)
+#include "fixed_bfin.h"
+#endif
+
+#endif
+
+
+#else
+
+#ifdef DOUBLE_PRECISION
+typedef double spx_mem_t;
+typedef double spx_coef_t;
+typedef double spx_lsp_t;
+typedef double spx_sig_t;
+typedef double spx_word16_t;
+typedef double spx_word32_t;
+
+#define Q15ONE 1.0
+#define LPC_SCALING 1.
+#define SIG_SCALING 1.
+#define LSP_SCALING 1.
+#define GAMMA_SCALING 1.
+#define GAIN_SCALING 1.
+#define GAIN_SCALING_1 1.
+
+
+#define VERY_SMALL 1e-20
+#define VERY_LARGE32 1e20
+#define VERY_LARGE16 1e20
+#define Q15_ONE ((spx_word16_t)1.)
+#else /* !DOUBLE_PRECISION */
+typedef float spx_mem_t;
+typedef float spx_coef_t;
+typedef float spx_lsp_t;
+typedef float spx_sig_t;
+typedef float spx_word16_t;
+typedef float spx_word32_t;
+
+#define Q15ONE 1.0f
+#define LPC_SCALING 1.f
+#define SIG_SCALING 1.f
+#define LSP_SCALING 1.f
+#define GAMMA_SCALING 1.f
+#define GAIN_SCALING 1.f
+#define GAIN_SCALING_1 1.f
+
+
+#define VERY_SMALL 1e-15f
+#define VERY_LARGE32 1e15f
+#define VERY_LARGE16 1e15f
+#define Q15_ONE ((spx_word16_t)1.f)
+#endif /* DOUBLE_PRECISION */
+
+#define QCONST16(x,bits) (x)
+#define QCONST32(x,bits) (x)
+
+#define NEG16(x) (-(x))
+#define NEG32(x) (-(x))
+#define EXTRACT16(x) (x)
+#define EXTEND32(x) (x)
+#define SHR16(a,shift) (a)
+#define SHL16(a,shift) (a)
+#define SHR32(a,shift) (a)
+#define SHL32(a,shift) (a)
+#define PSHR16(a,shift) (a)
+#define PSHR32(a,shift) (a)
+#define VSHR32(a,shift) (a)
+#define SATURATE16(x,a) (x)
+#define SATURATE32(x,a) (x)
+
+#define PSHR(a,shift) (a)
+#define SHR(a,shift) (a)
+#define SHL(a,shift) (a)
+#define SATURATE(x,a) (x)
+
+#define ADD16(a,b) ((a)+(b))
+#define SUB16(a,b) ((a)-(b))
+#define ADD32(a,b) ((a)+(b))
+#define SUB32(a,b) ((a)-(b))
+#define MULT16_16_16(a,b) ((a)*(b))
+#define MULT16_16(a,b) ((spx_word32_t)(a)*(spx_word32_t)(b))
+#define MAC16_16(c,a,b) ((c)+(spx_word32_t)(a)*(spx_word32_t)(b))
+
+#define MULT16_32_Q11(a,b) ((a)*(b))
+#define MULT16_32_Q13(a,b) ((a)*(b))
+#define MULT16_32_Q14(a,b) ((a)*(b))
+#define MULT16_32_Q15(a,b) ((a)*(b))
+#define MULT16_32_P15(a,b) ((a)*(b))
+
+#define MAC16_32_Q11(c,a,b) ((c)+(a)*(b))
+#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b))
+
+#define MAC16_16_Q11(c,a,b) ((c)+(a)*(b))
+#define MAC16_16_Q13(c,a,b) ((c)+(a)*(b))
+#define MAC16_16_P13(c,a,b) ((c)+(a)*(b))
+#define MULT16_16_Q11_32(a,b) ((a)*(b))
+#define MULT16_16_Q13(a,b) ((a)*(b))
+#define MULT16_16_Q14(a,b) ((a)*(b))
+#define MULT16_16_Q15(a,b) ((a)*(b))
+#define MULT16_16_P15(a,b) ((a)*(b))
+#define MULT16_16_P13(a,b) ((a)*(b))
+#define MULT16_16_P14(a,b) ((a)*(b))
+
+#define DIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
+#define PDIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
+#define DIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
+#define PDIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
+
+
+#endif
+
+
+#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
+
+/* 2 on TI C5x DSP */
+#define BYTES_PER_CHAR 2
+#define BITS_PER_CHAR 16
+#define LOG2_BITS_PER_CHAR 4
+
+#else
+
+#define BYTES_PER_CHAR 1
+#define BITS_PER_CHAR 8
+#define LOG2_BITS_PER_CHAR 3
+
+#endif
+
+
+
+#ifdef FIXED_DEBUG
+extern long long spx_mips;
+#endif
+
+
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/arch_float.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst/audioresample/arch_float.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,265 @@
+/* Copyright (C) 2003 Jean-Marc Valin */
+/**
+ @file arch.h
+ @brief Various architecture definitions Speex
+*/
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef ARCH_H
+#define ARCH_H
+
+#ifndef SPEEX_VERSION
+#define SPEEX_MAJOR_VERSION 1 /**< Major Speex version. */
+#define SPEEX_MINOR_VERSION 1 /**< Minor Speex version. */
+#define SPEEX_MICRO_VERSION 15 /**< Micro Speex version. */
+#define SPEEX_EXTRA_VERSION "" /**< Extra Speex version. */
+#define SPEEX_VERSION "speex-1.2beta3" /**< Speex version string. */
+#endif
+
+/* A couple test to catch stupid option combinations */
+#ifdef FIXED_POINT
+
+#ifdef FLOATING_POINT
+#error You cannot compile as floating point and fixed point at the same time
+#endif
+#ifdef _USE_SSE
+#error SSE is only for floating-point
+#endif
+#if ((defined (ARM4_ASM)||defined (ARM4_ASM)) && defined(BFIN_ASM)) || (defined (ARM4_ASM)&&defined(ARM5E_ASM))
+#error Make up your mind. What CPU do you have?
+#endif
+#ifdef VORBIS_PSYCHO
+#error Vorbis-psy model currently not implemented in fixed-point
+#endif
+
+#else
+
+#ifndef FLOATING_POINT
+#error You now need to define either FIXED_POINT or FLOATING_POINT
+#endif
+#if defined (ARM4_ASM) || defined(ARM5E_ASM) || defined(BFIN_ASM)
+#error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
+#endif
+#ifdef FIXED_POINT_DEBUG
+#error "Don't you think enabling fixed-point is a good thing to do if you want to debug that?"
+#endif
+
+
+#endif
+
+#ifndef OUTSIDE_SPEEX
+#include "../include/speex/speex_types.h"
+#endif
+
+#ifndef ABS
+#define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */
+#endif
+
+#define ABS16(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 16-bit value. */
+#define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 16-bit value. */
+#define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */
+#define ABS32(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 32-bit value. */
+#define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 32-bit value. */
+#define MAX32(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 32-bit value. */
+
+#ifdef FIXED_POINT
+
+typedef spx_int16_t spx_word16_t;
+typedef spx_int32_t spx_word32_t;
+typedef spx_word32_t spx_mem_t;
+typedef spx_word16_t spx_coef_t;
+typedef spx_word16_t spx_lsp_t;
+typedef spx_word32_t spx_sig_t;
+
+#define Q15ONE 32767
+
+#define LPC_SCALING 8192
+#define SIG_SCALING 16384
+#define LSP_SCALING 8192.
+#define GAMMA_SCALING 32768.
+#define GAIN_SCALING 64
+#define GAIN_SCALING_1 0.015625
+
+#define LPC_SHIFT 13
+#define LSP_SHIFT 13
+#define SIG_SHIFT 14
+#define GAIN_SHIFT 6
+
+#define VERY_SMALL 0
+#define VERY_LARGE32 ((spx_word32_t)2147483647)
+#define VERY_LARGE16 ((spx_word16_t)32767)
+#define Q15_ONE ((spx_word16_t)32767)
+
+
+#ifdef FIXED_DEBUG
+#include "fixed_debug.h"
+#else
+
+#include "fixed_generic.h"
+
+#ifdef ARM5E_ASM
+#include "fixed_arm5e.h"
+#elif defined (ARM4_ASM)
+#include "fixed_arm4.h"
+#elif defined (BFIN_ASM)
+#include "fixed_bfin.h"
+#endif
+
+#endif
+
+
+#else
+
+#ifdef DOUBLE_PRECISION
+typedef double spx_mem_t;
+typedef double spx_coef_t;
+typedef double spx_lsp_t;
+typedef double spx_sig_t;
+typedef double spx_word16_t;
+typedef double spx_word32_t;
+
+#define Q15ONE 1.0
+#define LPC_SCALING 1.
+#define SIG_SCALING 1.
+#define LSP_SCALING 1.
+#define GAMMA_SCALING 1.
+#define GAIN_SCALING 1.
+#define GAIN_SCALING_1 1.
+
+
+#define VERY_SMALL 1e-20
+#define VERY_LARGE32 1e20
+#define VERY_LARGE16 1e20
+#define Q15_ONE ((spx_word16_t)1.)
+#else /* !DOUBLE_PRECISION */
+typedef float spx_mem_t;
+typedef float spx_coef_t;
+typedef float spx_lsp_t;
+typedef float spx_sig_t;
+typedef float spx_word16_t;
+typedef float spx_word32_t;
+
+#define Q15ONE 1.0f
+#define LPC_SCALING 1.f
+#define SIG_SCALING 1.f
+#define LSP_SCALING 1.f
+#define GAMMA_SCALING 1.f
+#define GAIN_SCALING 1.f
+#define GAIN_SCALING_1 1.f
+
+
+#define VERY_SMALL 1e-15f
+#define VERY_LARGE32 1e15f
+#define VERY_LARGE16 1e15f
+#define Q15_ONE ((spx_word16_t)1.f)
+#endif /* DOUBLE_PRECISION */
+
+#define QCONST16(x,bits) (x)
+#define QCONST32(x,bits) (x)
+
+#define NEG16(x) (-(x))
+#define NEG32(x) (-(x))
+#define EXTRACT16(x) (x)
+#define EXTEND32(x) (x)
+#define SHR16(a,shift) (a)
+#define SHL16(a,shift) (a)
+#define SHR32(a,shift) (a)
+#define SHL32(a,shift) (a)
+#define PSHR16(a,shift) (a)
+#define PSHR32(a,shift) (a)
+#define VSHR32(a,shift) (a)
+#define SATURATE16(x,a) (x)
+#define SATURATE32(x,a) (x)
+
+#define PSHR(a,shift) (a)
+#define SHR(a,shift) (a)
+#define SHL(a,shift) (a)
+#define SATURATE(x,a) (x)
+
+#define ADD16(a,b) ((a)+(b))
+#define SUB16(a,b) ((a)-(b))
+#define ADD32(a,b) ((a)+(b))
+#define SUB32(a,b) ((a)-(b))
+#define MULT16_16_16(a,b) ((a)*(b))
+#define MULT16_16(a,b) ((spx_word32_t)(a)*(spx_word32_t)(b))
+#define MAC16_16(c,a,b) ((c)+(spx_word32_t)(a)*(spx_word32_t)(b))
+
+#define MULT16_32_Q11(a,b) ((a)*(b))
+#define MULT16_32_Q13(a,b) ((a)*(b))
+#define MULT16_32_Q14(a,b) ((a)*(b))
+#define MULT16_32_Q15(a,b) ((a)*(b))
+#define MULT16_32_P15(a,b) ((a)*(b))
+
+#define MAC16_32_Q11(c,a,b) ((c)+(a)*(b))
+#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b))
+
+#define MAC16_16_Q11(c,a,b) ((c)+(a)*(b))
+#define MAC16_16_Q13(c,a,b) ((c)+(a)*(b))
+#define MAC16_16_P13(c,a,b) ((c)+(a)*(b))
+#define MULT16_16_Q11_32(a,b) ((a)*(b))
+#define MULT16_16_Q13(a,b) ((a)*(b))
+#define MULT16_16_Q14(a,b) ((a)*(b))
+#define MULT16_16_Q15(a,b) ((a)*(b))
+#define MULT16_16_P15(a,b) ((a)*(b))
+#define MULT16_16_P13(a,b) ((a)*(b))
+#define MULT16_16_P14(a,b) ((a)*(b))
+
+#define DIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
+#define PDIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
+#define DIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
+#define PDIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
+
+
+#endif
+
+
+#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
+
+/* 2 on TI C5x DSP */
+#define BYTES_PER_CHAR 2
+#define BITS_PER_CHAR 16
+#define LOG2_BITS_PER_CHAR 4
+
+#else
+
+#define BYTES_PER_CHAR 1
+#define BITS_PER_CHAR 8
+#define LOG2_BITS_PER_CHAR 3
+
+#endif
+
+
+
+#ifdef FIXED_DEBUG
+extern long long spx_mips;
+#endif
+
+
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/arch_int.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst/audioresample/arch_int.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,265 @@
+/* Copyright (C) 2003 Jean-Marc Valin */
+/**
+ @file arch.h
+ @brief Various architecture definitions Speex
+*/
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef ARCH_H
+#define ARCH_H
+
+#ifndef SPEEX_VERSION
+#define SPEEX_MAJOR_VERSION 1 /**< Major Speex version. */
+#define SPEEX_MINOR_VERSION 1 /**< Minor Speex version. */
+#define SPEEX_MICRO_VERSION 15 /**< Micro Speex version. */
+#define SPEEX_EXTRA_VERSION "" /**< Extra Speex version. */
+#define SPEEX_VERSION "speex-1.2beta3" /**< Speex version string. */
+#endif
+
+/* A couple test to catch stupid option combinations */
+#ifdef FIXED_POINT
+
+#ifdef FLOATING_POINT
+#error You cannot compile as floating point and fixed point at the same time
+#endif
+#ifdef _USE_SSE
+#error SSE is only for floating-point
+#endif
+#if ((defined (ARM4_ASM)||defined (ARM4_ASM)) && defined(BFIN_ASM)) || (defined (ARM4_ASM)&&defined(ARM5E_ASM))
+#error Make up your mind. What CPU do you have?
+#endif
+#ifdef VORBIS_PSYCHO
+#error Vorbis-psy model currently not implemented in fixed-point
+#endif
+
+#else
+
+#ifndef FLOATING_POINT
+#error You now need to define either FIXED_POINT or FLOATING_POINT
+#endif
+#if defined (ARM4_ASM) || defined(ARM5E_ASM) || defined(BFIN_ASM)
+#error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
+#endif
+#ifdef FIXED_POINT_DEBUG
+#error "Don't you think enabling fixed-point is a good thing to do if you want to debug that?"
+#endif
+
+
+#endif
+
+#ifndef OUTSIDE_SPEEX
+#include "../include/speex/speex_types.h"
+#endif
+
+#ifndef ABS
+#define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */
+#endif
+
+#define ABS16(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 16-bit value. */
+#define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 16-bit value. */
+#define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */
+#define ABS32(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 32-bit value. */
+#define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 32-bit value. */
+#define MAX32(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 32-bit value. */
+
+#ifdef FIXED_POINT
+
+typedef spx_int16_t spx_word16_t;
+typedef spx_int32_t spx_word32_t;
+typedef spx_word32_t spx_mem_t;
+typedef spx_word16_t spx_coef_t;
+typedef spx_word16_t spx_lsp_t;
+typedef spx_word32_t spx_sig_t;
+
+#define Q15ONE 32767
+
+#define LPC_SCALING 8192
+#define SIG_SCALING 16384
+#define LSP_SCALING 8192.
+#define GAMMA_SCALING 32768.
+#define GAIN_SCALING 64
+#define GAIN_SCALING_1 0.015625
+
+#define LPC_SHIFT 13
+#define LSP_SHIFT 13
+#define SIG_SHIFT 14
+#define GAIN_SHIFT 6
+
+#define VERY_SMALL 0
+#define VERY_LARGE32 ((spx_word32_t)2147483647)
+#define VERY_LARGE16 ((spx_word16_t)32767)
+#define Q15_ONE ((spx_word16_t)32767)
+
+
+#ifdef FIXED_DEBUG
+#include "fixed_debug.h"
+#else
+
+#include "fixed_generic.h"
+
+#ifdef ARM5E_ASM
+#include "fixed_arm5e.h"
+#elif defined (ARM4_ASM)
+#include "fixed_arm4.h"
+#elif defined (BFIN_ASM)
+#include "fixed_bfin.h"
+#endif
+
+#endif
+
+
+#else
+
+#ifdef DOUBLE_PRECISION
+typedef double spx_mem_t;
+typedef double spx_coef_t;
+typedef double spx_lsp_t;
+typedef double spx_sig_t;
+typedef double spx_word16_t;
+typedef double spx_word32_t;
+
+#define Q15ONE 1.0
+#define LPC_SCALING 1.
+#define SIG_SCALING 1.
+#define LSP_SCALING 1.
+#define GAMMA_SCALING 1.
+#define GAIN_SCALING 1.
+#define GAIN_SCALING_1 1.
+
+
+#define VERY_SMALL 1e-20
+#define VERY_LARGE32 1e20
+#define VERY_LARGE16 1e20
+#define Q15_ONE ((spx_word16_t)1.)
+#else /* !DOUBLE_PRECISION */
+typedef float spx_mem_t;
+typedef float spx_coef_t;
+typedef float spx_lsp_t;
+typedef float spx_sig_t;
+typedef float spx_word16_t;
+typedef float spx_word32_t;
+
+#define Q15ONE 1.0f
+#define LPC_SCALING 1.f
+#define SIG_SCALING 1.f
+#define LSP_SCALING 1.f
+#define GAMMA_SCALING 1.f
+#define GAIN_SCALING 1.f
+#define GAIN_SCALING_1 1.f
+
+
+#define VERY_SMALL 1e-15f
+#define VERY_LARGE32 1e15f
+#define VERY_LARGE16 1e15f
+#define Q15_ONE ((spx_word16_t)1.f)
+#endif /* DOUBLE_PRECISION */
+
+#define QCONST16(x,bits) (x)
+#define QCONST32(x,bits) (x)
+
+#define NEG16(x) (-(x))
+#define NEG32(x) (-(x))
+#define EXTRACT16(x) (x)
+#define EXTEND32(x) (x)
+#define SHR16(a,shift) (a)
+#define SHL16(a,shift) (a)
+#define SHR32(a,shift) (a)
+#define SHL32(a,shift) (a)
+#define PSHR16(a,shift) (a)
+#define PSHR32(a,shift) (a)
+#define VSHR32(a,shift) (a)
+#define SATURATE16(x,a) (x)
+#define SATURATE32(x,a) (x)
+
+#define PSHR(a,shift) (a)
+#define SHR(a,shift) (a)
+#define SHL(a,shift) (a)
+#define SATURATE(x,a) (x)
+
+#define ADD16(a,b) ((a)+(b))
+#define SUB16(a,b) ((a)-(b))
+#define ADD32(a,b) ((a)+(b))
+#define SUB32(a,b) ((a)-(b))
+#define MULT16_16_16(a,b) ((a)*(b))
+#define MULT16_16(a,b) ((spx_word32_t)(a)*(spx_word32_t)(b))
+#define MAC16_16(c,a,b) ((c)+(spx_word32_t)(a)*(spx_word32_t)(b))
+
+#define MULT16_32_Q11(a,b) ((a)*(b))
+#define MULT16_32_Q13(a,b) ((a)*(b))
+#define MULT16_32_Q14(a,b) ((a)*(b))
+#define MULT16_32_Q15(a,b) ((a)*(b))
+#define MULT16_32_P15(a,b) ((a)*(b))
+
+#define MAC16_32_Q11(c,a,b) ((c)+(a)*(b))
+#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b))
+
+#define MAC16_16_Q11(c,a,b) ((c)+(a)*(b))
+#define MAC16_16_Q13(c,a,b) ((c)+(a)*(b))
+#define MAC16_16_P13(c,a,b) ((c)+(a)*(b))
+#define MULT16_16_Q11_32(a,b) ((a)*(b))
+#define MULT16_16_Q13(a,b) ((a)*(b))
+#define MULT16_16_Q14(a,b) ((a)*(b))
+#define MULT16_16_Q15(a,b) ((a)*(b))
+#define MULT16_16_P15(a,b) ((a)*(b))
+#define MULT16_16_P13(a,b) ((a)*(b))
+#define MULT16_16_P14(a,b) ((a)*(b))
+
+#define DIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
+#define PDIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
+#define DIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
+#define PDIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
+
+
+#endif
+
+
+#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
+
+/* 2 on TI C5x DSP */
+#define BYTES_PER_CHAR 2
+#define BITS_PER_CHAR 16
+#define LOG2_BITS_PER_CHAR 4
+
+#else
+
+#define BYTES_PER_CHAR 1
+#define BITS_PER_CHAR 8
+#define LOG2_BITS_PER_CHAR 3
+
+#endif
+
+
+
+#ifdef FIXED_DEBUG
+extern long long spx_mips;
+#endif
+
+
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/buffer.c
--- a/gst_plugins_base/gst/audioresample/buffer.c Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,309 +0,0 @@
-
-#ifndef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include
-#include
-
-#include "buffer.h"
-#include "debug.h"
-
-static void audioresample_buffer_free_mem (AudioresampleBuffer * buffer,
- void *);
-static void audioresample_buffer_free_subbuffer (AudioresampleBuffer * buffer,
- void *priv);
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-
-AudioresampleBuffer *
-audioresample_buffer_new (void)
-{
- AudioresampleBuffer *buffer;
-
- buffer = g_new0 (AudioresampleBuffer, 1);
- buffer->ref_count = 1;
- return buffer;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-AudioresampleBuffer *
-audioresample_buffer_new_and_alloc (int size)
-{
- AudioresampleBuffer *buffer = audioresample_buffer_new ();
-
- buffer->data = g_malloc (size);
- buffer->length = size;
- buffer->free = audioresample_buffer_free_mem;
-
- return buffer;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-AudioresampleBuffer *
-audioresample_buffer_new_with_data (void *data, int size)
-{
- AudioresampleBuffer *buffer = audioresample_buffer_new ();
-
- buffer->data = data;
- buffer->length = size;
- buffer->free = audioresample_buffer_free_mem;
-
- return buffer;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-AudioresampleBuffer *
-audioresample_buffer_new_subbuffer (AudioresampleBuffer * buffer, int offset,
- int length)
-{
- AudioresampleBuffer *subbuffer = audioresample_buffer_new ();
-
- if (buffer->parent) {
- audioresample_buffer_ref (buffer->parent);
- subbuffer->parent = buffer->parent;
- } else {
- audioresample_buffer_ref (buffer);
- subbuffer->parent = buffer;
- }
- subbuffer->data = buffer->data + offset;
- subbuffer->length = length;
- subbuffer->free = audioresample_buffer_free_subbuffer;
-
- return subbuffer;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-audioresample_buffer_ref (AudioresampleBuffer * buffer)
-{
- buffer->ref_count++;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-audioresample_buffer_unref (AudioresampleBuffer * buffer)
-{
- buffer->ref_count--;
- if (buffer->ref_count == 0) {
- if (buffer->free)
- buffer->free (buffer, buffer->priv);
- g_free (buffer);
- }
-}
-
-static void
-audioresample_buffer_free_mem (AudioresampleBuffer * buffer, void *priv)
-{
- g_free (buffer->data);
-}
-
-static void
-audioresample_buffer_free_subbuffer (AudioresampleBuffer * buffer, void *priv)
-{
- audioresample_buffer_unref (buffer->parent);
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-
-AudioresampleBufferQueue *
-audioresample_buffer_queue_new (void)
-{
- return g_new0 (AudioresampleBufferQueue, 1);
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-int
-audioresample_buffer_queue_get_depth (AudioresampleBufferQueue * queue)
-{
- return queue->depth;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-int
-audioresample_buffer_queue_get_offset (AudioresampleBufferQueue * queue)
-{
- return queue->offset;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-audioresample_buffer_queue_free (AudioresampleBufferQueue * queue)
-{
- GList *g;
-
- for (g = g_list_first (queue->buffers); g; g = g_list_next (g)) {
- audioresample_buffer_unref ((AudioresampleBuffer *) g->data);
- }
- g_list_free (queue->buffers);
- g_free (queue);
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-audioresample_buffer_queue_push (AudioresampleBufferQueue * queue,
- AudioresampleBuffer * buffer)
-{
- queue->buffers = g_list_append (queue->buffers, buffer);
- queue->depth += buffer->length;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-AudioresampleBuffer *
-audioresample_buffer_queue_pull (AudioresampleBufferQueue * queue, int length)
-{
- GList *g;
- AudioresampleBuffer *newbuffer;
- AudioresampleBuffer *buffer;
- AudioresampleBuffer *subbuffer;
-
- g_return_val_if_fail (length > 0, NULL);
-
- if (queue->depth < length) {
- return NULL;
- }
-
- RESAMPLE_LOG ("pulling %d, %d available", length, queue->depth);
-
- g = g_list_first (queue->buffers);
- buffer = g->data;
-
- if (buffer->length > length) {
- newbuffer = audioresample_buffer_new_subbuffer (buffer, 0, length);
-
- subbuffer = audioresample_buffer_new_subbuffer (buffer, length,
- buffer->length - length);
- g->data = subbuffer;
- audioresample_buffer_unref (buffer);
- } else {
- int offset = 0;
-
- newbuffer = audioresample_buffer_new_and_alloc (length);
-
- while (offset < length) {
- g = g_list_first (queue->buffers);
- buffer = g->data;
-
- if (buffer->length > length - offset) {
- int n = length - offset;
-
- memcpy (newbuffer->data + offset, buffer->data, n);
- subbuffer =
- audioresample_buffer_new_subbuffer (buffer, n, buffer->length - n);
- g->data = subbuffer;
- audioresample_buffer_unref (buffer);
- offset += n;
- } else {
- memcpy (newbuffer->data + offset, buffer->data, buffer->length);
-
- queue->buffers = g_list_delete_link (queue->buffers, g);
- offset += buffer->length;
- audioresample_buffer_unref (buffer);
- }
- }
- }
-
- queue->depth -= length;
- queue->offset += length;
-
- return newbuffer;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-AudioresampleBuffer *
-audioresample_buffer_queue_peek (AudioresampleBufferQueue * queue, int length)
-{
- GList *g;
- AudioresampleBuffer *newbuffer;
- AudioresampleBuffer *buffer;
- int offset = 0;
-
- g_return_val_if_fail (length > 0, NULL);
-
- if (queue->depth < length) {
- return NULL;
- }
-
- RESAMPLE_LOG ("peeking %d, %d available", length, queue->depth);
-
- g = g_list_first (queue->buffers);
- buffer = g->data;
- if (buffer->length > length) {
- newbuffer = audioresample_buffer_new_subbuffer (buffer, 0, length);
- } else {
- newbuffer = audioresample_buffer_new_and_alloc (length);
- while (offset < length) {
- buffer = g->data;
-
- if (buffer->length > length - offset) {
- int n = length - offset;
-
- memcpy (newbuffer->data + offset, buffer->data, n);
- offset += n;
- } else {
- memcpy (newbuffer->data + offset, buffer->data, buffer->length);
- offset += buffer->length;
- }
- g = g_list_next (g);
- }
- }
-
- return newbuffer;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-audioresample_buffer_queue_flush (AudioresampleBufferQueue * queue)
-{
- GList *g;
-
- for (g = g_list_first (queue->buffers); g; g = g_list_next (g)) {
- audioresample_buffer_unref ((AudioresampleBuffer *) g->data);
- }
- g_list_free (queue->buffers);
- queue->buffers = NULL;
- queue->depth = 0;
- queue->offset = 0;
-}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/buffer.h
--- a/gst_plugins_base/gst/audioresample/buffer.h Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-
-#ifndef __AUDIORESAMPLE_BUFFER_H__
-#define __AUDIORESAMPLE_BUFFER_H__
-
-#include
-
-typedef struct _AudioresampleBuffer AudioresampleBuffer;
-typedef struct _AudioresampleBufferQueue AudioresampleBufferQueue;
-
-struct _AudioresampleBuffer
-{
- unsigned char *data;
- int length;
-
- int ref_count;
-
- AudioresampleBuffer *parent;
-
- void (*free) (AudioresampleBuffer *, void *);
- void *priv;
- void *priv2;
-};
-
-struct _AudioresampleBufferQueue
-{
- GList *buffers;
- int depth;
- int offset;
-};
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-
-AudioresampleBuffer * audioresample_buffer_new (void);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-AudioresampleBuffer * audioresample_buffer_new_and_alloc (int size);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-AudioresampleBuffer * audioresample_buffer_new_with_data (void *data, int size);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-AudioresampleBuffer * audioresample_buffer_new_subbuffer (AudioresampleBuffer * buffer,
- int offset,
- int length);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void audioresample_buffer_ref (AudioresampleBuffer * buffer);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void audioresample_buffer_unref (AudioresampleBuffer * buffer);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-
-AudioresampleBufferQueue *
- audioresample_buffer_queue_new (void);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void audioresample_buffer_queue_free (AudioresampleBufferQueue * queue);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-int audioresample_buffer_queue_get_depth (AudioresampleBufferQueue * queue);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-int audioresample_buffer_queue_get_offset (AudioresampleBufferQueue * queue);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void audioresample_buffer_queue_push (AudioresampleBufferQueue * queue,
- AudioresampleBuffer * buffer);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-AudioresampleBuffer * audioresample_buffer_queue_pull (AudioresampleBufferQueue * queue, int len);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-AudioresampleBuffer * audioresample_buffer_queue_peek (AudioresampleBufferQueue * queue, int len);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void audioresample_buffer_queue_flush (AudioresampleBufferQueue * queue);
-
-#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/debug.h
--- a/gst_plugins_base/gst/audioresample/debug.h Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-
-#ifndef __RESAMPLE_DEBUG_H__
-#define __RESAMPLE_DEBUG_H__
-
-#if 0
-enum
-{
- RESAMPLE_LEVEL_NONE = 0,
- RESAMPLE_LEVEL_ERROR,
- RESAMPLE_LEVEL_WARNING,
- RESAMPLE_LEVEL_INFO,
- RESAMPLE_LEVEL_DEBUG,
- RESAMPLE_LEVEL_LOG
-};
-
-#define RESAMPLE_ERROR(...) \
- RESAMPLE_DEBUG_LEVEL(RESAMPLE_LEVEL_ERROR, __VA_ARGS__)
-#define RESAMPLE_WARNING(...) \
- RESAMPLE_DEBUG_LEVEL(RESAMPLE_LEVEL_WARNING, __VA_ARGS__)
-#define RESAMPLE_INFO(...) \
- RESAMPLE_DEBUG_LEVEL(RESAMPLE_LEVEL_INFO, __VA_ARGS__)
-#define RESAMPLE_DEBUG(...) \
- RESAMPLE_DEBUG_LEVEL(RESAMPLE_LEVEL_DEBUG, __VA_ARGS__)
-#define RESAMPLE_LOG(...) \
- RESAMPLE_DEBUG_LEVEL(RESAMPLE_LEVEL_LOG, __VA_ARGS__)
-
-#define RESAMPLE_DEBUG_LEVEL(level,...) \
- resample_debug_log ((level), __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
-
-void resample_debug_log (int level, const char *file, const char *function,
- int line, const char *format, ...);
-void resample_debug_set_level (int level);
-int resample_debug_get_level (void);
-#else
-
-#include
-
-GST_DEBUG_CATEGORY_EXTERN (libaudioresample_debug);
-#define GST_CAT_DEFAULT libaudioresample_debug
-
-#define RESAMPLE_ERROR GST_ERROR
-#define RESAMPLE_WARNING GST_WARNING
-#define RESAMPLE_INFO GST_INFO
-#define RESAMPLE_DEBUG GST_DEBUG
-#define RESAMPLE_LOG GST_LOG
-
-#define resample_debug_set_level(x) do { } while (0)
-
-#endif
-
-#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/fixed_arm4.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst/audioresample/fixed_arm4.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,130 @@
+/* Copyright (C) 2004 Jean-Marc Valin */
+/**
+ @file fixed_arm4.h
+ @brief ARM4 fixed-point operations
+*/
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef FIXED_ARM4_H
+#define FIXED_ARM4_H
+
+#undef MULT16_32_Q14
+static inline spx_word32_t
+MULT16_32_Q14 (spx_word16_t x, spx_word32_t y)
+{
+ int res;
+ int dummy;
+asm ("smull %0,%1,%2,%3 \n\t" "mov %0, %0, lsr #14 \n\t" "add %0, %0, %1, lsl #18 \n\t":"=&r" (res),
+ "=&r"
+ (dummy)
+: "r" (y), "r" ((int) x));
+ return (res);
+}
+
+#undef MULT16_32_Q15
+static inline spx_word32_t
+MULT16_32_Q15 (spx_word16_t x, spx_word32_t y)
+{
+ int res;
+ int dummy;
+asm ("smull %0,%1,%2,%3 \n\t" "mov %0, %0, lsr #15 \n\t" "add %0, %0, %1, lsl #17 \n\t":"=&r" (res),
+ "=&r"
+ (dummy)
+: "r" (y), "r" ((int) x));
+ return (res);
+}
+
+#undef DIV32_16
+static inline short
+DIV32_16 (int a, int b)
+{
+ int res = 0;
+ int dead1, dead2, dead3, dead4, dead5;
+ __asm__ __volatile__ ("\teor %5, %0, %1\n"
+ "\tmovs %4, %0\n"
+ "\trsbmi %0, %0, #0 \n"
+ "\tmovs %4, %1\n"
+ "\trsbmi %1, %1, #0 \n"
+ "\tmov %4, #1\n"
+ "\tsubs %3, %0, %1, asl #14 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #14 \n"
+ "\tsubs %3, %0, %1, asl #13 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #13 \n"
+ "\tsubs %3, %0, %1, asl #12 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #12 \n"
+ "\tsubs %3, %0, %1, asl #11 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #11 \n"
+ "\tsubs %3, %0, %1, asl #10 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #10 \n"
+ "\tsubs %3, %0, %1, asl #9 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #9 \n"
+ "\tsubs %3, %0, %1, asl #8 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #8 \n"
+ "\tsubs %3, %0, %1, asl #7 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #7 \n"
+ "\tsubs %3, %0, %1, asl #6 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #6 \n"
+ "\tsubs %3, %0, %1, asl #5 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #5 \n"
+ "\tsubs %3, %0, %1, asl #4 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #4 \n"
+ "\tsubs %3, %0, %1, asl #3 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #3 \n"
+ "\tsubs %3, %0, %1, asl #2 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #2 \n"
+ "\tsubs %3, %0, %1, asl #1 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4, asl #1 \n"
+ "\tsubs %3, %0, %1 \n"
+ "\tmovpl %0, %3 \n"
+ "\torrpl %2, %2, %4 \n"
+ "\tmovs %5, %5, lsr #31 \n"
+ "\trsbne %2, %2, #0 \n":"=r" (dead1), "=r" (dead2), "=r" (res),
+ "=r" (dead3), "=r" (dead4), "=r" (dead5)
+ :"0" (a), "1" (b), "2" (res)
+ :"cc");
+ return res;
+}
+
+
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/fixed_arm5e.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst/audioresample/fixed_arm5e.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,166 @@
+/* Copyright (C) 2003 Jean-Marc Valin */
+/**
+ @file fixed_arm5e.h
+ @brief ARM-tuned fixed-point operations
+*/
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef FIXED_ARM5E_H
+#define FIXED_ARM5E_H
+
+#undef MULT16_16
+static inline spx_word32_t
+MULT16_16 (spx_word16_t x, spx_word16_t y)
+{
+ int res;
+asm ("smulbb %0,%1,%2;\n":"=&r" (res)
+: "%r" (x), "r" (y));
+ return (res);
+}
+
+#undef MAC16_16
+static inline spx_word32_t
+MAC16_16 (spx_word32_t a, spx_word16_t x, spx_word32_t y)
+{
+ int res;
+asm ("smlabb %0,%1,%2,%3;\n":"=&r" (res)
+: "%r" (x), "r" (y), "r" (a));
+ return (res);
+}
+
+#undef MULT16_32_Q15
+static inline spx_word32_t
+MULT16_32_Q15 (spx_word16_t x, spx_word32_t y)
+{
+ int res;
+asm ("smulwb %0,%1,%2;\n":"=&r" (res)
+: "%r" (y << 1), "r" (x));
+ return (res);
+}
+
+#undef MAC16_32_Q15
+static inline spx_word32_t
+MAC16_32_Q15 (spx_word32_t a, spx_word16_t x, spx_word32_t y)
+{
+ int res;
+asm ("smlawb %0,%1,%2,%3;\n":"=&r" (res)
+: "%r" (y << 1), "r" (x), "r" (a));
+ return (res);
+}
+
+#undef MULT16_32_Q11
+static inline spx_word32_t
+MULT16_32_Q11 (spx_word16_t x, spx_word32_t y)
+{
+ int res;
+asm ("smulwb %0,%1,%2;\n":"=&r" (res)
+: "%r" (y << 5), "r" (x));
+ return (res);
+}
+
+#undef MAC16_32_Q11
+static inline spx_word32_t
+MAC16_32_Q11 (spx_word32_t a, spx_word16_t x, spx_word32_t y)
+{
+ int res;
+asm ("smlawb %0,%1,%2,%3;\n":"=&r" (res)
+: "%r" (y << 5), "r" (x), "r" (a));
+ return (res);
+}
+
+#undef DIV32_16
+static inline short
+DIV32_16 (int a, int b)
+{
+ int res = 0;
+ int dead1, dead2, dead3, dead4, dead5;
+ __asm__ __volatile__ ("\teor %5, %0, %1\n"
+ "\tmovs %4, %0\n"
+ "\trsbmi %0, %0, #0 \n"
+ "\tmovs %4, %1\n"
+ "\trsbmi %1, %1, #0 \n"
+ "\tmov %4, #1\n"
+ "\tsubs %3, %0, %1, asl #14 \n"
+ "\torrpl %2, %2, %4, asl #14 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #13 \n"
+ "\torrpl %2, %2, %4, asl #13 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #12 \n"
+ "\torrpl %2, %2, %4, asl #12 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #11 \n"
+ "\torrpl %2, %2, %4, asl #11 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #10 \n"
+ "\torrpl %2, %2, %4, asl #10 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #9 \n"
+ "\torrpl %2, %2, %4, asl #9 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #8 \n"
+ "\torrpl %2, %2, %4, asl #8 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #7 \n"
+ "\torrpl %2, %2, %4, asl #7 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #6 \n"
+ "\torrpl %2, %2, %4, asl #6 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #5 \n"
+ "\torrpl %2, %2, %4, asl #5 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #4 \n"
+ "\torrpl %2, %2, %4, asl #4 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #3 \n"
+ "\torrpl %2, %2, %4, asl #3 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #2 \n"
+ "\torrpl %2, %2, %4, asl #2 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1, asl #1 \n"
+ "\torrpl %2, %2, %4, asl #1 \n"
+ "\tmovpl %0, %3 \n"
+ "\tsubs %3, %0, %1 \n"
+ "\torrpl %2, %2, %4 \n"
+ "\tmovpl %0, %3 \n"
+ "\tmovs %5, %5, lsr #31 \n"
+ "\trsbne %2, %2, #0 \n":"=r" (dead1), "=r" (dead2), "=r" (res),
+ "=r" (dead3), "=r" (dead4), "=r" (dead5)
+ :"0" (a), "1" (b), "2" (res)
+ :"memory", "cc");
+ return res;
+}
+
+
+
+
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/fixed_bfin.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst/audioresample/fixed_bfin.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,134 @@
+/* Copyright (C) 2005 Analog Devices
+ Author: Jean-Marc Valin */
+/**
+ @file fixed_bfin.h
+ @brief Blackfin fixed-point operations
+*/
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef FIXED_BFIN_H
+#define FIXED_BFIN_H
+
+#undef PDIV32_16
+static inline spx_word16_t
+PDIV32_16 (spx_word32_t a, spx_word16_t b)
+{
+ spx_word32_t res, bb;
+ bb = b;
+ a += b >> 1;
+ __asm__ ("P0 = 15;\n\t" "R0 = %1;\n\t" "R1 = %2;\n\t"
+ //"R0 = R0 + R1;\n\t"
+"R0 <<= 1;\n\t" "DIVS (R0, R1);\n\t" "LOOP divide%= LC0 = P0;\n\t" "LOOP_BEGIN divide%=;\n\t" "DIVQ (R0, R1);\n\t" "LOOP_END divide%=;\n\t" "R0 = R0.L;\n\t" "%0 = R0;\n\t":"=m"
+ (res)
+: "m" (a), "m" (bb)
+: "P0", "R0", "R1", "cc");
+ return res;
+}
+
+#undef DIV32_16
+static inline spx_word16_t
+DIV32_16 (spx_word32_t a, spx_word16_t b)
+{
+ spx_word32_t res, bb;
+ bb = b;
+ /* Make the roundinf consistent with the C version
+ (do we need to do that?) */
+ if (a < 0)
+ a += (b - 1);
+__asm__ ("P0 = 15;\n\t" "R0 = %1;\n\t" "R1 = %2;\n\t" "R0 <<= 1;\n\t" "DIVS (R0, R1);\n\t" "LOOP divide%= LC0 = P0;\n\t" "LOOP_BEGIN divide%=;\n\t" "DIVQ (R0, R1);\n\t" "LOOP_END divide%=;\n\t" "R0 = R0.L;\n\t" "%0 = R0;\n\t":"=m" (res)
+: "m" (a), "m" (bb)
+: "P0", "R0", "R1", "cc");
+ return res;
+}
+
+#undef MAX16
+static inline spx_word16_t
+MAX16 (spx_word16_t a, spx_word16_t b)
+{
+ spx_word32_t res;
+__asm__ ("%1 = %1.L (X);\n\t" "%2 = %2.L (X);\n\t" "%0 = MAX(%1,%2);":"=d" (res)
+: "%d" (a), "d" (b)
+ );
+ return res;
+}
+
+#undef MULT16_32_Q15
+static inline spx_word32_t
+MULT16_32_Q15 (spx_word16_t a, spx_word32_t b)
+{
+ spx_word32_t res;
+__asm__ ("A1 = %2.L*%1.L (M);\n\t" "A1 = A1 >>> 15;\n\t" "%0 = (A1 += %2.L*%1.H) ;\n\t":"=&W" (res),
+ "=&d"
+ (b)
+: "d" (a), "1" (b)
+: "A1");
+ return res;
+}
+
+#undef MAC16_32_Q15
+static inline spx_word32_t
+MAC16_32_Q15 (spx_word32_t c, spx_word16_t a, spx_word32_t b)
+{
+ spx_word32_t res;
+__asm__ ("A1 = %2.L*%1.L (M);\n\t" "A1 = A1 >>> 15;\n\t" "%0 = (A1 += %2.L*%1.H);\n\t" "%0 = %0 + %4;\n\t":"=&W" (res),
+ "=&d"
+ (b)
+: "d" (a), "1" (b), "d" (c)
+: "A1");
+ return res;
+}
+
+#undef MULT16_32_Q14
+static inline spx_word32_t
+MULT16_32_Q14 (spx_word16_t a, spx_word32_t b)
+{
+ spx_word32_t res;
+__asm__ ("%2 <<= 1;\n\t" "A1 = %1.L*%2.L (M);\n\t" "A1 = A1 >>> 15;\n\t" "%0 = (A1 += %1.L*%2.H);\n\t":"=W" (res), "=d" (a),
+ "=d"
+ (b)
+: "1" (a), "2" (b)
+: "A1");
+ return res;
+}
+
+#undef MAC16_32_Q14
+static inline spx_word32_t
+MAC16_32_Q14 (spx_word32_t c, spx_word16_t a, spx_word32_t b)
+{
+ spx_word32_t res;
+__asm__ ("%1 <<= 1;\n\t" "A1 = %2.L*%1.L (M);\n\t" "A1 = A1 >>> 15;\n\t" "%0 = (A1 += %2.L*%1.H);\n\t" "%0 = %0 + %4;\n\t":"=&W" (res),
+ "=&d"
+ (b)
+: "d" (a), "1" (b), "d" (c)
+: "A1");
+ return res;
+}
+
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/fixed_debug.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst/audioresample/fixed_debug.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,525 @@
+/* Copyright (C) 2003 Jean-Marc Valin */
+/**
+ @file fixed_debug.h
+ @brief Fixed-point operations with debugging
+*/
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef FIXED_DEBUG_H
+#define FIXED_DEBUG_H
+
+#include
+
+extern long long spx_mips;
+#define MIPS_INC spx_mips++,
+
+#define QCONST16(x,bits) ((spx_word16_t)(.5+(x)*(((spx_word32_t)1)<<(bits))))
+#define QCONST32(x,bits) ((spx_word32_t)(.5+(x)*(((spx_word32_t)1)<<(bits))))
+
+
+#define VERIFY_SHORT(x) ((x)<=32767&&(x)>=-32768)
+#define VERIFY_INT(x) ((x)<=2147483647LL&&(x)>=-2147483648LL)
+
+static inline short
+NEG16 (int x)
+{
+ int res;
+ if (!VERIFY_SHORT (x)) {
+ fprintf (stderr, "NEG16: input is not short: %d\n", (int) x);
+ }
+ res = -x;
+ if (!VERIFY_SHORT (res))
+ fprintf (stderr, "NEG16: output is not short: %d\n", (int) res);
+ spx_mips++;
+ return res;
+}
+
+static inline int
+NEG32 (long long x)
+{
+ long long res;
+ if (!VERIFY_INT (x)) {
+ fprintf (stderr, "NEG16: input is not int: %d\n", (int) x);
+ }
+ res = -x;
+ if (!VERIFY_INT (res))
+ fprintf (stderr, "NEG16: output is not int: %d\n", (int) res);
+ spx_mips++;
+ return res;
+}
+
+#define EXTRACT16(x) _EXTRACT16(x, __FILE__, __LINE__)
+static inline short
+_EXTRACT16 (int x, char *file, int line)
+{
+ int res;
+ if (!VERIFY_SHORT (x)) {
+ fprintf (stderr, "EXTRACT16: input is not short: %d in %s: line %d\n", x,
+ file, line);
+ }
+ res = x;
+ spx_mips++;
+ return res;
+}
+
+#define EXTEND32(x) _EXTEND32(x, __FILE__, __LINE__)
+static inline int
+_EXTEND32 (int x, char *file, int line)
+{
+ int res;
+ if (!VERIFY_SHORT (x)) {
+ fprintf (stderr, "EXTEND32: input is not short: %d in %s: line %d\n", x,
+ file, line);
+ }
+ res = x;
+ spx_mips++;
+ return res;
+}
+
+#define SHR16(a, shift) _SHR16(a, shift, __FILE__, __LINE__)
+static inline short
+_SHR16 (int a, int shift, char *file, int line)
+{
+ int res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (shift)) {
+ fprintf (stderr, "SHR16: inputs are not short: %d >> %d in %s: line %d\n",
+ a, shift, file, line);
+ }
+ res = a >> shift;
+ if (!VERIFY_SHORT (res))
+ fprintf (stderr, "SHR16: output is not short: %d in %s: line %d\n", res,
+ file, line);
+ spx_mips++;
+ return res;
+}
+
+#define SHL16(a, shift) _SHL16(a, shift, __FILE__, __LINE__)
+static inline short
+_SHL16 (int a, int shift, char *file, int line)
+{
+ int res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (shift)) {
+ fprintf (stderr, "SHL16: inputs are not short: %d %d in %s: line %d\n", a,
+ shift, file, line);
+ }
+ res = a << shift;
+ if (!VERIFY_SHORT (res))
+ fprintf (stderr, "SHL16: output is not short: %d in %s: line %d\n", res,
+ file, line);
+ spx_mips++;
+ return res;
+}
+
+static inline int
+SHR32 (long long a, int shift)
+{
+ long long res;
+ if (!VERIFY_INT (a) || !VERIFY_SHORT (shift)) {
+ fprintf (stderr, "SHR32: inputs are not int: %d %d\n", (int) a, shift);
+ }
+ res = a >> shift;
+ if (!VERIFY_INT (res)) {
+ fprintf (stderr, "SHR32: output is not int: %d\n", (int) res);
+ }
+ spx_mips++;
+ return res;
+}
+
+static inline int
+SHL32 (long long a, int shift)
+{
+ long long res;
+ if (!VERIFY_INT (a) || !VERIFY_SHORT (shift)) {
+ fprintf (stderr, "SHL32: inputs are not int: %d %d\n", (int) a, shift);
+ }
+ res = a << shift;
+ if (!VERIFY_INT (res)) {
+ fprintf (stderr, "SHL32: output is not int: %d\n", (int) res);
+ }
+ spx_mips++;
+ return res;
+}
+
+#define PSHR16(a,shift) (SHR16(ADD16((a),((1<<((shift))>>1))),shift))
+#define PSHR32(a,shift) (SHR32(ADD32((a),((EXTEND32(1)<<((shift))>>1))),shift))
+#define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift)))
+
+#define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
+#define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
+
+//#define SHR(a,shift) ((a) >> (shift))
+//#define SHL(a,shift) ((a) << (shift))
+
+#define ADD16(a, b) _ADD16(a, b, __FILE__, __LINE__)
+static inline short
+_ADD16 (int a, int b, char *file, int line)
+{
+ int res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "ADD16: inputs are not short: %d %d in %s: line %d\n", a,
+ b, file, line);
+ }
+ res = a + b;
+ if (!VERIFY_SHORT (res)) {
+ fprintf (stderr, "ADD16: output is not short: %d+%d=%d in %s: line %d\n", a,
+ b, res, file, line);
+ }
+ spx_mips++;
+ return res;
+}
+
+#define SUB16(a, b) _SUB16(a, b, __FILE__, __LINE__)
+static inline short
+_SUB16 (int a, int b, char *file, int line)
+{
+ int res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "SUB16: inputs are not short: %d %d in %s: line %d\n", a,
+ b, file, line);
+ }
+ res = a - b;
+ if (!VERIFY_SHORT (res))
+ fprintf (stderr, "SUB16: output is not short: %d in %s: line %d\n", res,
+ file, line);
+ spx_mips++;
+ return res;
+}
+
+#define ADD32(a, b) _ADD32(a, b, __FILE__, __LINE__)
+static inline int
+_ADD32 (long long a, long long b, char *file, int line)
+{
+ long long res;
+ if (!VERIFY_INT (a) || !VERIFY_INT (b)) {
+ fprintf (stderr, "ADD32: inputs are not int: %d %d in %s: line %d\n",
+ (int) a, (int) b, file, line);
+ }
+ res = a + b;
+ if (!VERIFY_INT (res)) {
+ fprintf (stderr, "ADD32: output is not int: %d in %s: line %d\n", (int) res,
+ file, line);
+ }
+ spx_mips++;
+ return res;
+}
+
+static inline int
+SUB32 (long long a, long long b)
+{
+ long long res;
+ if (!VERIFY_INT (a) || !VERIFY_INT (b)) {
+ fprintf (stderr, "SUB32: inputs are not int: %d %d\n", (int) a, (int) b);
+ }
+ res = a - b;
+ if (!VERIFY_INT (res))
+ fprintf (stderr, "SUB32: output is not int: %d\n", (int) res);
+ spx_mips++;
+ return res;
+}
+
+#define ADD64(a,b) (MIPS_INC(a)+(b))
+
+/* result fits in 16 bits */
+static inline short
+MULT16_16_16 (int a, int b)
+{
+ int res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "MULT16_16_16: inputs are not short: %d %d\n", a, b);
+ }
+ res = a * b;
+ if (!VERIFY_SHORT (res))
+ fprintf (stderr, "MULT16_16_16: output is not short: %d\n", res);
+ spx_mips++;
+ return res;
+}
+
+#define MULT16_16(a, b) _MULT16_16(a, b, __FILE__, __LINE__)
+static inline int
+_MULT16_16 (int a, int b, char *file, int line)
+{
+ long long res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "MULT16_16: inputs are not short: %d %d in %s: line %d\n",
+ a, b, file, line);
+ }
+ res = ((long long) a) * b;
+ if (!VERIFY_INT (res))
+ fprintf (stderr, "MULT16_16: output is not int: %d in %s: line %d\n",
+ (int) res, file, line);
+ spx_mips++;
+ return res;
+}
+
+#define MAC16_16(c,a,b) (spx_mips--,ADD32((c),MULT16_16((a),(b))))
+#define MAC16_16_Q11(c,a,b) (EXTRACT16(ADD16((c),EXTRACT16(SHR32(MULT16_16((a),(b)),11)))))
+#define MAC16_16_Q13(c,a,b) (EXTRACT16(ADD16((c),EXTRACT16(SHR32(MULT16_16((a),(b)),13)))))
+#define MAC16_16_P13(c,a,b) (EXTRACT16(ADD32((c),SHR32(ADD32(4096,MULT16_16((a),(b))),13))))
+
+
+#define MULT16_32_QX(a, b, Q) _MULT16_32_QX(a, b, Q, __FILE__, __LINE__)
+static inline int
+_MULT16_32_QX (int a, long long b, int Q, char *file, int line)
+{
+ long long res;
+ if (!VERIFY_SHORT (a) || !VERIFY_INT (b)) {
+ fprintf (stderr,
+ "MULT16_32_Q%d: inputs are not short+int: %d %d in %s: line %d\n", Q,
+ (int) a, (int) b, file, line);
+ }
+ if (ABS32 (b) >= (EXTEND32 (1) << (15 + Q)))
+ fprintf (stderr,
+ "MULT16_32_Q%d: second operand too large: %d %d in %s: line %d\n", Q,
+ (int) a, (int) b, file, line);
+ res = (((long long) a) * (long long) b) >> Q;
+ if (!VERIFY_INT (res))
+ fprintf (stderr,
+ "MULT16_32_Q%d: output is not int: %d*%d=%d in %s: line %d\n", Q,
+ (int) a, (int) b, (int) res, file, line);
+ spx_mips += 5;
+ return res;
+}
+
+static inline int
+MULT16_32_PX (int a, long long b, int Q)
+{
+ long long res;
+ if (!VERIFY_SHORT (a) || !VERIFY_INT (b)) {
+ fprintf (stderr, "MULT16_32_P%d: inputs are not short+int: %d %d\n", Q,
+ (int) a, (int) b);
+ }
+ if (ABS32 (b) >= (EXTEND32 (1) << (15 + Q)))
+ fprintf (stderr, "MULT16_32_Q%d: second operand too large: %d %d\n", Q,
+ (int) a, (int) b);
+ res = ((((long long) a) * (long long) b) + ((EXTEND32 (1) << Q) >> 1)) >> Q;
+ if (!VERIFY_INT (res))
+ fprintf (stderr, "MULT16_32_P%d: output is not int: %d*%d=%d\n", Q, (int) a,
+ (int) b, (int) res);
+ spx_mips += 5;
+ return res;
+}
+
+
+#define MULT16_32_Q11(a,b) MULT16_32_QX(a,b,11)
+#define MAC16_32_Q11(c,a,b) ADD32((c),MULT16_32_Q11((a),(b)))
+#define MULT16_32_Q12(a,b) MULT16_32_QX(a,b,12)
+#define MULT16_32_Q13(a,b) MULT16_32_QX(a,b,13)
+#define MULT16_32_Q14(a,b) MULT16_32_QX(a,b,14)
+#define MULT16_32_Q15(a,b) MULT16_32_QX(a,b,15)
+#define MULT16_32_P15(a,b) MULT16_32_PX(a,b,15)
+#define MAC16_32_Q15(c,a,b) ADD32((c),MULT16_32_Q15((a),(b)))
+
+static inline int
+SATURATE (int a, int b)
+{
+ if (a > b)
+ a = b;
+ if (a < -b)
+ a = -b;
+ return a;
+}
+
+static inline int
+MULT16_16_Q11_32 (int a, int b)
+{
+ long long res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "MULT16_16_Q11: inputs are not short: %d %d\n", a, b);
+ }
+ res = ((long long) a) * b;
+ res >>= 11;
+ if (!VERIFY_INT (res))
+ fprintf (stderr, "MULT16_16_Q11: output is not short: %d*%d=%d\n", (int) a,
+ (int) b, (int) res);
+ spx_mips += 3;
+ return res;
+}
+
+static inline short
+MULT16_16_Q13 (int a, int b)
+{
+ long long res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "MULT16_16_Q13: inputs are not short: %d %d\n", a, b);
+ }
+ res = ((long long) a) * b;
+ res >>= 13;
+ if (!VERIFY_SHORT (res))
+ fprintf (stderr, "MULT16_16_Q13: output is not short: %d*%d=%d\n", a, b,
+ (int) res);
+ spx_mips += 3;
+ return res;
+}
+
+static inline short
+MULT16_16_Q14 (int a, int b)
+{
+ long long res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "MULT16_16_Q14: inputs are not short: %d %d\n", a, b);
+ }
+ res = ((long long) a) * b;
+ res >>= 14;
+ if (!VERIFY_SHORT (res))
+ fprintf (stderr, "MULT16_16_Q14: output is not short: %d\n", (int) res);
+ spx_mips += 3;
+ return res;
+}
+
+static inline short
+MULT16_16_Q15 (int a, int b)
+{
+ long long res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "MULT16_16_Q15: inputs are not short: %d %d\n", a, b);
+ }
+ res = ((long long) a) * b;
+ res >>= 15;
+ if (!VERIFY_SHORT (res)) {
+ fprintf (stderr, "MULT16_16_Q15: output is not short: %d\n", (int) res);
+ }
+ spx_mips += 3;
+ return res;
+}
+
+static inline short
+MULT16_16_P13 (int a, int b)
+{
+ long long res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "MULT16_16_P13: inputs are not short: %d %d\n", a, b);
+ }
+ res = ((long long) a) * b;
+ res += 4096;
+ if (!VERIFY_INT (res))
+ fprintf (stderr, "MULT16_16_P13: overflow: %d*%d=%d\n", a, b, (int) res);
+ res >>= 13;
+ if (!VERIFY_SHORT (res))
+ fprintf (stderr, "MULT16_16_P13: output is not short: %d*%d=%d\n", a, b,
+ (int) res);
+ spx_mips += 4;
+ return res;
+}
+
+static inline short
+MULT16_16_P14 (int a, int b)
+{
+ long long res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "MULT16_16_P14: inputs are not short: %d %d\n", a, b);
+ }
+ res = ((long long) a) * b;
+ res += 8192;
+ if (!VERIFY_INT (res))
+ fprintf (stderr, "MULT16_16_P14: overflow: %d*%d=%d\n", a, b, (int) res);
+ res >>= 14;
+ if (!VERIFY_SHORT (res))
+ fprintf (stderr, "MULT16_16_P14: output is not short: %d*%d=%d\n", a, b,
+ (int) res);
+ spx_mips += 4;
+ return res;
+}
+
+static inline short
+MULT16_16_P15 (int a, int b)
+{
+ long long res;
+ if (!VERIFY_SHORT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr, "MULT16_16_P15: inputs are not short: %d %d\n", a, b);
+ }
+ res = ((long long) a) * b;
+ res += 16384;
+ if (!VERIFY_INT (res))
+ fprintf (stderr, "MULT16_16_P15: overflow: %d*%d=%d\n", a, b, (int) res);
+ res >>= 15;
+ if (!VERIFY_SHORT (res))
+ fprintf (stderr, "MULT16_16_P15: output is not short: %d*%d=%d\n", a, b,
+ (int) res);
+ spx_mips += 4;
+ return res;
+}
+
+#define DIV32_16(a, b) _DIV32_16(a, b, __FILE__, __LINE__)
+
+static inline int
+_DIV32_16 (long long a, long long b, char *file, int line)
+{
+ long long res;
+ if (b == 0) {
+ fprintf (stderr, "DIV32_16: divide by zero: %d/%d in %s: line %d\n",
+ (int) a, (int) b, file, line);
+ return 0;
+ }
+ if (!VERIFY_INT (a) || !VERIFY_SHORT (b)) {
+ fprintf (stderr,
+ "DIV32_16: inputs are not int/short: %d %d in %s: line %d\n", (int) a,
+ (int) b, file, line);
+ }
+ res = a / b;
+ if (!VERIFY_SHORT (res)) {
+ fprintf (stderr,
+ "DIV32_16: output is not short: %d / %d = %d in %s: line %d\n", (int) a,
+ (int) b, (int) res, file, line);
+ if (res > 32767)
+ res = 32767;
+ if (res < -32768)
+ res = -32768;
+ }
+ spx_mips += 20;
+ return res;
+}
+
+#define DIV32(a, b) _DIV32(a, b, __FILE__, __LINE__)
+static inline int
+_DIV32 (long long a, long long b, char *file, int line)
+{
+ long long res;
+ if (b == 0) {
+ fprintf (stderr, "DIV32: divide by zero: %d/%d in %s: line %d\n", (int) a,
+ (int) b, file, line);
+ return 0;
+ }
+
+ if (!VERIFY_INT (a) || !VERIFY_INT (b)) {
+ fprintf (stderr, "DIV32: inputs are not int/short: %d %d in %s: line %d\n",
+ (int) a, (int) b, file, line);
+ }
+ res = a / b;
+ if (!VERIFY_INT (res))
+ fprintf (stderr, "DIV32: output is not int: %d in %s: line %d\n", (int) res,
+ file, line);
+ spx_mips += 36;
+ return res;
+}
+
+#define PDIV32(a,b) DIV32(ADD32((a),(b)>>1),b)
+#define PDIV32_16(a,b) DIV32_16(ADD32((a),(b)>>1),b)
+
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/fixed_generic.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gst_plugins_base/gst/audioresample/fixed_generic.h Wed Mar 24 18:04:17 2010 -0500
@@ -0,0 +1,106 @@
+/* Copyright (C) 2003 Jean-Marc Valin */
+/**
+ @file fixed_generic.h
+ @brief Generic fixed-point operations
+*/
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef FIXED_GENERIC_H
+#define FIXED_GENERIC_H
+
+#define QCONST16(x,bits) ((spx_word16_t)(.5+(x)*(((spx_word32_t)1)<<(bits))))
+#define QCONST32(x,bits) ((spx_word32_t)(.5+(x)*(((spx_word32_t)1)<<(bits))))
+
+#define NEG16(x) (-(x))
+#define NEG32(x) (-(x))
+#define EXTRACT16(x) ((spx_word16_t)(x))
+#define EXTEND32(x) ((spx_word32_t)(x))
+#define SHR16(a,shift) ((a) >> (shift))
+#define SHL16(a,shift) ((a) << (shift))
+#define SHR32(a,shift) ((a) >> (shift))
+#define SHL32(a,shift) ((a) << (shift))
+#define PSHR16(a,shift) (SHR16((a)+((1<<((shift))>>1)),shift))
+#define PSHR32(a,shift) (SHR32((a)+((EXTEND32(1)<<((shift))>>1)),shift))
+#define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift)))
+#define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
+#define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
+
+#define SHR(a,shift) ((a) >> (shift))
+#define SHL(a,shift) ((spx_word32_t)(a) << (shift))
+#define PSHR(a,shift) (SHR((a)+((EXTEND32(1)<<((shift))>>1)),shift))
+#define SATURATE(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
+
+
+#define ADD16(a,b) ((spx_word16_t)((spx_word16_t)(a)+(spx_word16_t)(b)))
+#define SUB16(a,b) ((spx_word16_t)(a)-(spx_word16_t)(b))
+#define ADD32(a,b) ((spx_word32_t)(a)+(spx_word32_t)(b))
+#define SUB32(a,b) ((spx_word32_t)(a)-(spx_word32_t)(b))
+
+
+/* result fits in 16 bits */
+#define MULT16_16_16(a,b) ((((spx_word16_t)(a))*((spx_word16_t)(b))))
+
+/* (spx_word32_t)(spx_word16_t) gives TI compiler a hint that it's 16x16->32 multiply */
+#define MULT16_16(a,b) (((spx_word32_t)(spx_word16_t)(a))*((spx_word32_t)(spx_word16_t)(b)))
+
+#define MAC16_16(c,a,b) (ADD32((c),MULT16_16((a),(b))))
+#define MULT16_32_Q12(a,b) ADD32(MULT16_16((a),SHR((b),12)), SHR(MULT16_16((a),((b)&0x00000fff)),12))
+#define MULT16_32_Q13(a,b) ADD32(MULT16_16((a),SHR((b),13)), SHR(MULT16_16((a),((b)&0x00001fff)),13))
+#define MULT16_32_Q14(a,b) ADD32(MULT16_16((a),SHR((b),14)), SHR(MULT16_16((a),((b)&0x00003fff)),14))
+
+#define MULT16_32_Q11(a,b) ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11))
+#define MAC16_32_Q11(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11)))
+
+#define MULT16_32_P15(a,b) ADD32(MULT16_16((a),SHR((b),15)), PSHR(MULT16_16((a),((b)&0x00007fff)),15))
+#define MULT16_32_Q15(a,b) ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15))
+#define MAC16_32_Q15(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15)))
+
+
+#define MAC16_16_Q11(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),11)))
+#define MAC16_16_Q13(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),13)))
+#define MAC16_16_P13(c,a,b) (ADD32((c),SHR(ADD32(4096,MULT16_16((a),(b))),13)))
+
+#define MULT16_16_Q11_32(a,b) (SHR(MULT16_16((a),(b)),11))
+#define MULT16_16_Q13(a,b) (SHR(MULT16_16((a),(b)),13))
+#define MULT16_16_Q14(a,b) (SHR(MULT16_16((a),(b)),14))
+#define MULT16_16_Q15(a,b) (SHR(MULT16_16((a),(b)),15))
+
+#define MULT16_16_P13(a,b) (SHR(ADD32(4096,MULT16_16((a),(b))),13))
+#define MULT16_16_P14(a,b) (SHR(ADD32(8192,MULT16_16((a),(b))),14))
+#define MULT16_16_P15(a,b) (SHR(ADD32(16384,MULT16_16((a),(b))),15))
+
+#define MUL_16_32_R15(a,bh,bl) ADD32(MULT16_16((a),(bh)), SHR(MULT16_16((a),(bl)),15))
+
+#define DIV32_16(a,b) ((spx_word16_t)(((spx_word32_t)(a))/((spx_word16_t)(b))))
+#define PDIV32_16(a,b) ((spx_word16_t)(((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word16_t)(b))))
+#define DIV32(a,b) (((spx_word32_t)(a))/((spx_word32_t)(b)))
+#define PDIV32(a,b) (((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word32_t)(b)))
+
+#endif
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/functable.c
--- a/gst_plugins_base/gst/audioresample/functable.c Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,309 +0,0 @@
-/* Resampling library
- * Copyright (C) <2001> David A. Schleef
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#ifndef __SYMBIAN32__
-#include
-#else
-#include "config.h"
-#endif
-#endif
-
-#include
-#include
-#include
-#include
-
-#include "functable.h"
-#include "debug.h"
-
-
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-void
-functable_func_sinc (double *fx, double *dfx, double x, void *closure)
-{
- if (x == 0) {
- *fx = 1;
- *dfx = 0;
- return;
- }
-
- *fx = sin (x) / x;
- *dfx = (cos (x) - sin (x) / x) / x;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-functable_func_boxcar (double *fx, double *dfx, double x, void *closure)
-{
- double width = *(double *) closure;
-
- if (x < width && x > -width) {
- *fx = 1;
- } else {
- *fx = 0;
- }
- *dfx = 0;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-functable_func_hanning (double *fx, double *dfx, double x, void *closure)
-{
- double width = *(double *) closure;
-
- if (x < width && x > -width) {
- x /= width;
- *fx = (1 - x * x) * (1 - x * x);
- *dfx = -2 * 2 * x / width * (1 - x * x);
- } else {
- *fx = 0;
- *dfx = 0;
- }
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-
-Functable *
-functable_new (void)
-{
- Functable *ft;
-
- ft = malloc (sizeof (Functable));
- memset (ft, 0, sizeof (Functable));
-
- return ft;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-functable_free (Functable * ft)
-{
- free (ft);
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-functable_set_length (Functable * t, int length)
-{
- t->length = length;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-functable_set_offset (Functable * t, double offset)
-{
- t->offset = offset;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-functable_set_multiplier (Functable * t, double multiplier)
-{
- t->multiplier = multiplier;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-functable_calculate (Functable * t, FunctableFunc func, void *closure)
-{
- int i;
- double x;
-
- if (t->fx)
- free (t->fx);
- if (t->dfx)
- free (t->dfx);
-
- t->fx = malloc (sizeof (double) * (t->length + 1));
- t->dfx = malloc (sizeof (double) * (t->length + 1));
-
- t->inv_multiplier = 1.0 / t->multiplier;
-
- for (i = 0; i < t->length + 1; i++) {
- x = t->offset + t->multiplier * i;
-
- func (&t->fx[i], &t->dfx[i], x, closure);
- }
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-functable_calculate_multiply (Functable * t, FunctableFunc func, void *closure)
-{
- int i;
- double x;
-
- for (i = 0; i < t->length + 1; i++) {
- double afx, adfx, bfx, bdfx;
-
- afx = t->fx[i];
- adfx = t->dfx[i];
- x = t->offset + t->multiplier * i;
- func (&bfx, &bdfx, x, closure);
- t->fx[i] = afx * bfx;
- t->dfx[i] = afx * bdfx + adfx * bfx;
- }
-
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-double
-functable_evaluate (Functable * t, double x)
-{
- int i;
- double f0, f1, w0, w1;
- double x2, x3;
- double w;
-
- if (x < t->offset || x > (t->offset + t->length * t->multiplier)) {
- RESAMPLE_DEBUG ("x out of range %g", x);
- }
-
- x -= t->offset;
- x *= t->inv_multiplier;
- i = floor (x);
- x -= i;
-
- x2 = x * x;
- x3 = x2 * x;
-
- f1 = 3 * x2 - 2 * x3;
- f0 = 1 - f1;
- w0 = (x - 2 * x2 + x3) * t->multiplier;
- w1 = (-x2 + x3) * t->multiplier;
-
- w = t->fx[i] * f0 + t->fx[i + 1] * f1 + t->dfx[i] * w0 + t->dfx[i + 1] * w1;
-
- /*w = t->fx[i] * (1-x) + t->fx[i+1] * x; */
-
- return w;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-
-double
-functable_fir (Functable * t, double x, int n, double *data, int len)
-{
- int i, j;
- double f0, f1, w0, w1;
- double x2, x3;
- double w;
- double sum;
-
- x -= t->offset;
- x /= t->multiplier;
- i = floor (x);
- x -= i;
-
- x2 = x * x;
- x3 = x2 * x;
-
- f1 = 3 * x2 - 2 * x3;
- f0 = 1 - f1;
- w0 = (x - 2 * x2 + x3) * t->multiplier;
- w1 = (-x2 + x3) * t->multiplier;
-
- sum = 0;
- for (j = 0; j < len; j++) {
- w = t->fx[i] * f0 + t->fx[i + 1] * f1 + t->dfx[i] * w0 + t->dfx[i + 1] * w1;
- sum += data[j * 2] * w;
- i += n;
- }
-
- return sum;
-}
-#ifdef __SYMBIAN32__
-EXPORT_C
-#endif
-
-
-void
-functable_fir2 (Functable * t, double *r0, double *r1, double x,
- int n, double *data, int len)
-{
- int i, j;
- double f0, f1, w0, w1;
- double x2, x3;
- double w;
- double sum0, sum1;
- double floor_x;
-
- x -= t->offset;
- x *= t->inv_multiplier;
- floor_x = floor (x);
- i = floor_x;
- x -= floor_x;
-
- x2 = x * x;
- x3 = x2 * x;
-
- f1 = 3 * x2 - 2 * x3;
- f0 = 1 - f1;
- w0 = (x - 2 * x2 + x3) * t->multiplier;
- w1 = (-x2 + x3) * t->multiplier;
-
- sum0 = 0;
- sum1 = 0;
- for (j = 0; j < len; j++) {
- w = t->fx[i] * f0 + t->fx[i + 1] * f1 + t->dfx[i] * w0 + t->dfx[i + 1] * w1;
- sum0 += data[j * 2] * w;
- sum1 += data[j * 2 + 1] * w;
- i += n;
- }
-
- *r0 = sum0;
- *r1 = sum1;
-}
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/functable.h
--- a/gst_plugins_base/gst/audioresample/functable.h Wed Mar 24 17:58:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/* Resampling library
- * Copyright (C) <2001> David Schleef
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-
-#ifndef __FUNCTABLE_H__
-#define __FUNCTABLE_H__
-
-typedef void FunctableFunc (double *fx, double *dfx, double x, void *closure);
-
-typedef struct _Functable Functable;
-struct _Functable {
- int length;
-
- double offset;
- double multiplier;
-
- double inv_multiplier;
-
- double *fx;
- double *dfx;
-};
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-
-Functable *functable_new (void);
-void functable_setup (Functable *t);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void functable_free (Functable *t);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-
-void functable_set_length (Functable *t, int length);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void functable_set_offset (Functable *t, double offset);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void functable_set_multiplier (Functable *t, double multiplier);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void functable_calculate (Functable *t, FunctableFunc func, void *closure);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void functable_calculate_multiply (Functable *t, FunctableFunc func, void *closure);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-
-
-double functable_evaluate (Functable *t,double x);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-
-double functable_fir(Functable *t,double x0,int n,double *data,int len);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void functable_fir2(Functable *t,double *r0, double *r1, double x0,
- int n,double *data,int len);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-
-void functable_func_sinc(double *fx, double *dfx, double x, void *closure);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void functable_func_boxcar(double *fx, double *dfx, double x, void *closure);
-#ifdef __SYMBIAN32__
-IMPORT_C
-#endif
-
-void functable_func_hanning(double *fx, double *dfx, double x, void *closure);
-
-#endif /* __PRIVATE_H__ */
-
diff -r 4b0c6ed43234 -r 8e837d1bf446 gst_plugins_base/gst/audioresample/gstaudioresample.c
--- a/gst_plugins_base/gst/audioresample/gstaudioresample.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gst_plugins_base/gst/audioresample/gstaudioresample.c Wed Mar 24 18:04:17 2010 -0500
@@ -1,6 +1,7 @@
/* GStreamer
* Copyright (C) 1999 Erik Walthinsen
* Copyright (C) 2003,2004 David A. Schleef
+ * Copyright (C) 2007-2008 Sebastian Dröge
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -17,25 +18,24 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-/* Element-Checklist-Version: 5 */
/**
* SECTION:element-audioresample
*
- *
- * Audioresample resamples raw audio buffers to different sample rates using
+ * audioresample resamples raw audio buffers to different sample rates using
* a configurable windowing function to enhance quality.
+ *
+ *
* Example launch line
- *
- *