~ubuntu-branches/ubuntu/trusty/parole/trusty-proposed

« back to all changes in this revision

Viewing changes to browser-plugin/plugin_types.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez
  • Date: 2010-04-28 21:42:11 UTC
  • Revision ID: james.westby@ubuntu.com-20100428214211-i7olyr9ch8tnpnaf
Tags: upstream-0.2.0.2
ImportĀ upstreamĀ versionĀ 0.2.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 
2
/* ***** BEGIN LICENSE BLOCK *****
 
3
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
4
 *
 
5
 * The contents of this file are subject to the Mozilla Public License Version
 
6
 * 1.1 (the "License"); you may not use this file except in compliance with
 
7
 * the License. You may obtain a copy of the License at
 
8
 * http://www.mozilla.org/MPL/
 
9
 *
 
10
 * Software distributed under the License is distributed on an "AS IS" basis,
 
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
12
 * for the specific language governing rights and limitations under the
 
13
 * License.
 
14
 *
 
15
 * The Original Code is mozilla.org code.
 
16
 *
 
17
 * The Initial Developer of the Original Code is
 
18
 * Netscape Communications Corporation.
 
19
 * Portions created by the Initial Developer are Copyright (C) 1998
 
20
 * the Initial Developer. All Rights Reserved.
 
21
 *
 
22
 * Contributor(s):
 
23
 *
 
24
 * Alternatively, the contents of this file may be used under the terms of
 
25
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
26
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
27
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
28
 * of those above. If you wish to allow use of your version of this file only
 
29
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
30
 * use your version of this file under the terms of the MPL, indicate your
 
31
 * decision by deleting the provisions above and replace them with the notice
 
32
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
33
 * the provisions above, a recipient may use your version of this file under
 
34
 * the terms of any one of the MPL, the GPL or the LGPL.
 
35
 *
 
36
 * ***** END LICENSE BLOCK ***** */
 
37
 
 
38
#include "plugin_types.h"
 
39
 
 
40
gchar *GetMIMEDescription()
 
41
{
 
42
    const gchar *mime_types_list = /* Wmp mime types */
 
43
                              "application/asx:*:Media Files;"
 
44
                              "video/x-ms-asf-plugin:*:Media Files;"
 
45
                              "video/x-msvideo:avi,*:AVI;"
 
46
                              "video/msvideo:avi,*:AVI;"
 
47
                              "application/x-mplayer2:*:Media Files;"
 
48
                              "application/x-ms-wmv:wmv,*:Microsoft WMV video;"
 
49
                              "video/x-ms-asf:asf,asx,*:Media Files;"
 
50
                              "video/x-ms-wm:wm,*:Media Files;"
 
51
                              "video/x-ms-wmv:wmv,*:Microsoft WMV video;"
 
52
                              "audio/x-ms-wmv:wmv,*:Windows Media;"
 
53
                              "video/x-ms-wmp:wmp,*:Windows Media;"
 
54
                              "application/x-ms-wmp:wmp,*:Windows Media;"
 
55
                              "video/x-ms-wvx:wvx,*:Windows Media;"
 
56
                              "audio/x-ms-wax:wax,*:Windows Media;"
 
57
                              "audio/x-ms-wma:wma,*:Windows Media;"
 
58
                              "application/x-drm-v2:asx,*:Windows Media;"
 
59
                              "audio/wav:wav,*:Microsoft wave file;"
 
60
                              "audio/x-wav:wav,*:Microsoft wave file;"
 
61
                              /* Standard mime types */
 
62
                              "audio/x-mpegurl:m3u:MPEG Playlist;"
 
63
                              "video/mpeg:mpg,mpeg:MPEG;"
 
64
                              "audio/mpeg:mpg,mpeg:MPEG;"
 
65
                              "video/x-mpeg:mpg,mpeg:MPEG;"
 
66
                              "video/x-mpeg2:mpv2,mp2ve:MPEG2;"
 
67
                              "audio/mpeg:mpg,mpeg:MPEG;"
 
68
                              "audio/x-mpeg:mpg,mpeg:MPEG;"
 
69
                              "audio/mpeg2:mp2:MPEG audio;"
 
70
                              "audio/x-mpeg2:mp2:MPEG audio;"
 
71
                              "audio/mp4:mp4:MPEG 4 audio;"
 
72
                              "audio/x-mp4:mp4:MPEG 4 audio;"
 
73
                              "video/mp4:mp4:MPEG 4 Video;"
 
74
                              "video/x-m4v:m4v:MPEG 4 Video;"
 
75
                              "video/3gpp:mp4,3gp:MPEG 4 Video;"
 
76
                              "application/x-ogg:ogg:Ogg Vorbis Media;"
 
77
                              "audio/flac:ogg:FLAC Lossless Audio;"
 
78
                              "audio/x-flac:ogg:FLAC Lossless Audio;"
 
79
                              "audio/ogg:ogg:Ogg Vorbis Audio;"
 
80
                              "audio/ogg:x-ogg:Ogg Vorbis Audio;"
 
81
                              "application/ogg:ogg:Ogg Vorbis / Ogg Theora;"
 
82
                              "video/ogg:ogg:Ogg Vorbis Video;"
 
83
                              "video/ogg:x-ogg:Ogg Vorbis Video;"
 
84
                              /* Real audio */
 
85
                              "audio/x-pn-realaudio:ram,rm:RealAudio;"
 
86
                              "application/vnd.rn-realmedia:rm:RealMedia;"
 
87
                              "application/vnd.rn-realaudio:ra,ram:RealAudio;"
 
88
                              "video/vnd.rn-realvideo:rv:RealVideo;"
 
89
                              "audio/x-realaudio:ra:RealAudio;"
 
90
                              "audio/x-pn-realaudio-plugin:rpm:RealAudio;"
 
91
                              "application/smil:smil:SMIL;"
 
92
                              /* DivX Mime type */
 
93
                              "video/divx:divx:DivX Media Format;"
 
94
                              "video/vnd.divx:divx:DivX Media Format;"
 
95
                              /*Quick time */
 
96
                              "video/quicktime:mov:Quicktime;"
 
97
                              "video/x-quicktime:mov:Quicktime;"
 
98
                              "image/x-quicktime:mov:Quicktime;"
 
99
                              "video/quicktime:mp4:Quicktime;"
 
100
                              "video/quicktime:sdp:Quicktime - Session Description Protocol;"
 
101
                              "application/x-quicktimeplayer:mov:Quicktime;";
 
102
 
 
103
    //g_debug ("GetMimeDescription");
 
104
                             
 
105
    return g_strdup (mime_types_list);
 
106
}
 
107
 
 
108
NPError PluginGetValue(NPPVariable variable, void *value)
 
109
{
 
110
    NPError err = NPERR_NO_ERROR;
 
111
    
 
112
    // some sites use this description to figure out what formats can be played. So we have to make sure the 
 
113
    // description matches the features
 
114
 
 
115
    if (variable == NPPVpluginNameString) {
 
116
        *((const char **) value) = "Parole media player plugin-in";
 
117
    }
 
118
    if (variable == NPPVpluginDescriptionString) {
 
119
        *((const char **) value) =
 
120
            "Media player browser plugin for various media format version " VERSION;
 
121
 
 
122
    }
 
123
 
 
124
    if (variable == NPPVpluginNeedsXEmbed) {
 
125
        *((bool *) value) = TRUE;
 
126
    }
 
127
 
 
128
    if ((variable != NPPVpluginNameString)
 
129
        && (variable != NPPVpluginDescriptionString)
 
130
        && (variable != NPPVpluginNeedsXEmbed)) {
 
131
        err = NPERR_INVALID_PARAM;
 
132
    }
 
133
 
 
134
    return err;
 
135
}