[vlc-devel] vlc-devel Digest, Vol 56, Issue 90

jean-michel Lambert jean-michel.lambert7 at wanadoo.fr
Sat Jan 14 09:11:02 CET 2012


On 14/01/2012 02:46, vlc-devel-request at videolan.org wrote:
> Send vlc-devel mailing list submissions to
> 	vlc-devel at videolan.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://mailman.videolan.org/listinfo/vlc-devel
> or, via email, send a message with subject or body 'help' to
> 	vlc-devel-request at videolan.org
>
> You can reach the person managing the list at
> 	vlc-devel-owner at videolan.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of vlc-devel digest..."
>
>
> Today's Topics:
>
>     1. [PATCH] NPAPI change: introduce MediaDescription object	for
>        exposing media meta information (JM Lambert)
>     2. mpris.vlc dbus location (Kevin Anthony)
>     3. compile vlc 1.2-git error 'qfu' was not declared (zhu shi song)
>     4. Re: compile vlc 1.2-git error 'qfu' was not declared
>        (Francois Cartegnie)
>     5. Add v4l2 output module (Francois Cartegnie)
>     6. [PATCH 1/2] split some v4l2 declarations (Francois Cartegnie)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 13 Jan 2012 18:35:25 +0100
> From: JM Lambert<jeanmichel.lambert7 at gmail.com>
> To: vlc-devel at videolan.org
> Cc: JM Lambert<jean-michel.lambert7 at wanadoo.fr>
> Subject: [vlc-devel] [PATCH] NPAPI change: introduce MediaDescription
> 	object	for exposing media meta information
> Message-ID:
> 	<1326476125-23574-1-git-send-email-jean-michel.lambert7 at wanadoo.fr>
>
> ---
>   npapi/control/npolibvlc.cpp |  143 +++++++++++++++++++++++++++++++++++++++++++
>   npapi/control/npolibvlc.h   |   24 +++++++-
>   2 files changed, 166 insertions(+), 1 deletions(-)
>
> diff --git a/npapi/control/npolibvlc.cpp b/npapi/control/npolibvlc.cpp
> index a8a94f6..cc37b72 100644
> --- a/npapi/control/npolibvlc.cpp
> +++ b/npapi/control/npolibvlc.cpp
> @@ -88,6 +88,7 @@ LibvlcRootNPObject::~LibvlcRootNPObject()
>           if( playlistObj ) NPN_ReleaseObject(playlistObj);
>           if( subtitleObj ) NPN_ReleaseObject(subtitleObj);
>           if( videoObj    ) NPN_ReleaseObject(videoObj);
> +        if( mediaDescriptionObj ) NPN_ReleaseObject(mediaDescriptionObj);
>       }
>   }
>
> @@ -99,6 +100,7 @@ const NPUTF8 * const LibvlcRootNPObject::propertyNames[] =
>       "subtitle",
>       "video",
>       "VersionInfo",
> +    "MediaDescription"
>   };
>   COUNTNAMES(LibvlcRootNPObject,propertyCount,propertyNames);
>
> @@ -110,6 +112,7 @@ enum LibvlcRootNPObjectPropertyIds
>       ID_root_subtitle,
>       ID_root_video,
>       ID_root_VersionInfo,
> +    ID_root_MediaDescription,
>   };
>
>   RuntimeNPObject::InvokeResult
> @@ -142,6 +145,12 @@ LibvlcRootNPObject::getProperty(int index, NPVariant&result)
>                   return INVOKERESULT_NO_ERROR;
>               case ID_root_VersionInfo:
>                   return invokeResultString(libvlc_get_version(),result);
> +            case ID_root_MediaDescription:
> +            {
> +                InstantObj<LibvlcMediaDescriptionNPObject>( mediaDescriptionObj );
> +                OBJECT_TO_NPVARIANT(NPN_RetainObject(mediaDescriptionObj), result);
> +                return INVOKERESULT_NO_ERROR;
> +            }
>               default:
>                   ;
>           }
> @@ -616,6 +625,140 @@ LibvlcInputNPObject::invoke(int index, const NPVariant *args,
>   }
>
>   /*
> +** implementation of libvlc MediaDescription object
> +*/
> +
> +const NPUTF8 * const LibvlcMediaDescriptionNPObject::propertyNames[] =
> +{
> +    "title",
> +    "artist",
> +    "genre",
> +    "copyright",
> +    "album",
> +    "trackNumber",
> +    "description",
> +    "rating",
> +    "date",
> +    "setting",
> +    "URL",
> +    "language",
> +    "nowPlaying",
> +    "publisher",
> +    "encodedBy",
> +    "artworkURL",
> +    "trackID",
> +};
> +COUNTNAMES(LibvlcMediaDescriptionNPObject,propertyCount,propertyNames);
> +
> +enum LibvlcMediaDescriptionNPObjectPropertyIds
> +{
> +    ID_meta_title,
> +    ID_meta_artist,
> +    ID_meta_genre,
> +    ID_meta_copyright,
> +    ID_meta_album,
> +    ID_meta_trackNumber,
> +    ID_meta_description,
> +    ID_meta_rating,
> +    ID_meta_date,
> +    ID_meta_setting,
> +    ID_meta_URL,
> +    ID_meta_language,
> +    ID_meta_nowPlaying,
> +    ID_meta_publisher,
> +    ID_meta_encodedBy,
> +    ID_meta_artworkURL,
> +    ID_meta_trackID,
> +};
> +RuntimeNPObject::InvokeResult
> +LibvlcMediaDescriptionNPObject::getProperty(int index, NPVariant&result)
> +{
> +    /* is plugin still running */
> +    if( isPluginRunning() )
> +    {
> +        VlcPlugin* p_plugin = getPrivate<VlcPlugin>();
> +        libvlc_media_player_t *p_md = p_plugin->getMD();
> +        if( !p_md )
> +            RETURN_ON_ERROR;
> +        libvlc_media_t * p_media = libvlc_media_player_get_media(p_md);
> +        if( !p_media )
> +            RETURN_ON_ERROR;
> +        const char *info;
> +        switch( index )
> +        {
> +            case ID_meta_title:
> +            case ID_meta_artist:
> +            case ID_meta_genre:
> +            case ID_meta_copyright:
> +            case ID_meta_album:
> +            case ID_meta_trackNumber:
> +            case ID_meta_description:
> +            case ID_meta_rating:
> +            case ID_meta_date:
> +            case ID_meta_setting:
> +            case ID_meta_URL:
> +            case ID_meta_language:
> +            case ID_meta_nowPlaying:
> +            case ID_meta_publisher:
> +            case ID_meta_encodedBy:
> +            case ID_meta_artworkURL:
> +            case ID_meta_trackID:
> +                info = libvlc_media_get_meta(p_media,(libvlc_meta_t) index);
> +                return invokeResultString(info, result);
> +            default:
> +            ;
> +        }
> +     }
> +     return INVOKERESULT_GENERIC_ERROR;
> +}
> +
> +RuntimeNPObject::InvokeResult
> +LibvlcMediaDescriptionNPObject::setProperty(int index, const NPVariant&value)
> +{
> +    /* is plugin still running */
> +    if( isPluginRunning() )
> +    {
> +        switch( index )
> +        {
> +            case ID_none:
> +                return INVOKERESULT_NO_SUCH_METHOD;
> +            default:
> +                ;
> +        }
> +    }
> +    return INVOKERESULT_GENERIC_ERROR;
> +}
> +
> +const NPUTF8 * const LibvlcMediaDescriptionNPObject::methodNames[] =
> +{
> +    "None"
> +};
> +COUNTNAMES(LibvlcMediaDescriptionNPObject,methodCount,methodNames);
> +
> +enum LibvlcMediaDescriptionNPObjectMethodIds
> +{
> +    ID_mediadescription_method_none,
> +};
> +RuntimeNPObject::InvokeResult
> +LibvlcMediaDescriptionNPObject::invoke(int index, const NPVariant *args,
> +                            uint32_t argCount, NPVariant&result)
> +{
> +    /* is plugin still running */
> +    if( isPluginRunning() )
> +    {
> +        switch( index )
> +        {
> +            case ID_mediadescription_method_none:
> +                return INVOKERESULT_NO_SUCH_METHOD;
> +            default:
> +                ;
> +        }
> +    }
> +    return INVOKERESULT_GENERIC_ERROR;
> +}
> +
> +
> +/*
>   ** implementation of libvlc playlist items object
>   */
>
> diff --git a/npapi/control/npolibvlc.h b/npapi/control/npolibvlc.h
> index c6d8694..d5a57b9 100644
> --- a/npapi/control/npolibvlc.h
> +++ b/npapi/control/npolibvlc.h
> @@ -38,7 +38,8 @@ protected:
>       inputObj(NULL),
>       playlistObj(NULL),
>       subtitleObj(NULL),
> -    videoObj(NULL) { }
> +    videoObj(NULL),
> +    mediaDescriptionObj(NULL) { }
>
>       virtual ~LibvlcRootNPObject();
>
> @@ -58,6 +59,7 @@ private:
>       NPObject *playlistObj;
>       NPObject *subtitleObj;
>       NPObject *videoObj;
> +    NPObject *mediaDescriptionObj;
>   };
>
>   class LibvlcAudioNPObject: public RuntimeNPObject
> @@ -103,6 +105,26 @@ protected:
>       InvokeResult invoke(int index, const NPVariant *args, uint32_t argCount, NPVariant&result);
>   };
>
> +class LibvlcMediaDescriptionNPObject: public RuntimeNPObject
> +{
> +protected:
> +    friend class RuntimeNPClass<LibvlcMediaDescriptionNPObject>;
> +    LibvlcMediaDescriptionNPObject(NPP instance, const NPClass *aClass) :
> +        RuntimeNPObject(instance, aClass) {};
> +    virtual ~LibvlcMediaDescriptionNPObject() {};
> +
> +    static const int propertyCount;
> +    static const NPUTF8 * const propertyNames[];
> +
> +    InvokeResult getProperty(int index, NPVariant&result);
> +    InvokeResult setProperty(int index, const NPVariant&value);
> +
> +    static const int methodCount;
> +    static const NPUTF8 * const methodNames[];
> +
> +    InvokeResult invoke(int index, const NPVariant *args, uint32_t argCount, NPVariant&result);
> +};
> +
>   class LibvlcPlaylistItemsNPObject: public RuntimeNPObject
>   {
>   protected:
Apologize, just disregard this patch, messed up with git and sent 
previous version of the patch



More information about the vlc-devel mailing list