876d2719681959884fc48a6968b8971ac1e3fa6f
[profile/ivi/rygel.git] / src / plugins / test / rygel-test-video-item.vala
1 /*
2  * Copyright (C) 2008 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
3  * Copyright (C) 2008 Nokia Corporation.
4  *
5  * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
6  *                               <zeeshan.ali@nokia.com>
7  *
8  * This file is part of Rygel.
9  *
10  * Rygel is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * Rygel is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23  */
24
25 using Gst;
26
27 /**
28  * Represents Test video item.
29  */
30 public class Rygel.Test.VideoItem : Rygel.VideoItem {
31     private const string TEST_MIMETYPE = "video/mpeg";
32     private const string PIPELINE = "videotestsrc is-live=1 ! " +
33                                     "ffenc_mpeg2video ! " +
34                                     "mpegtsmux";
35
36     public VideoItem (string id, MediaContainer parent, string title) {
37         base (id, parent, title);
38
39         this.mime_type = TEST_MIMETYPE;
40     }
41
42     public override Element? create_stream_source () {
43         try {
44             return parse_bin_from_description (PIPELINE, true);
45         } catch (Error err) {
46             warning ("Required plugin missing (%s)", err.message);
47
48             return null;
49         }
50     }
51 }
52