video_widget.h 3.03 KB
Newer Older
1
/*
Sébastien Blin's avatar
Sébastien Blin committed
2
 *  Copyright (C) 2015-2019 Savoir-faire Linux Inc.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 *  Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
 */

#ifndef __VIDEO_WIDGET_H__
#define __VIDEO_WIDGET_H__

#include <gtk/gtk.h>
#include <video/renderer.h>
25
#include <api/newvideo.h>
26

27 28 29 30 31 32 33
namespace lrc
{
namespace api
{
    class AVModel;
}
}
34

35 36 37 38 39 40 41 42 43 44
G_BEGIN_DECLS

#define VIDEO_WIDGET_TYPE              (video_widget_get_type())
#define VIDEO_WIDGET(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), VIDEO_WIDGET_TYPE, VideoWidget))
#define VIDEO_WIDGET_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), VIDEO_WIDGET_TYPE, VideoWidgetClass))
#define IS_VIDEO_WIDGET(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIDEO_WIDGET_TYPE))
#define IS_VIDEO_WIDGET_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), VIDEO_WIDGET_TYPE))

typedef struct _VideoWidgetClass VideoWidgetClass;
typedef struct _VideoWidget VideoWidget;
45 46 47 48 49 50 51

typedef enum {
    VIDEO_RENDERER_REMOTE,
    VIDEO_RENDERER_LOCAL,
    VIDEO_RENDERER_COUNT
} VideoRendererType;

52
/* Public interface */
53 54
GType           video_widget_get_type          (void) G_GNUC_CONST;
GtkWidget*      video_widget_new               (void);
55
void            video_widget_add_new_renderer (VideoWidget*, lrc::api::AVModel* avModel, const lrc::api::video::Renderer*, VideoRendererType);
56
void            video_widget_pause_rendering   (VideoWidget *self, gboolean pause);
57 58 59 60 61 62 63
void            video_widget_on_drag_data_received (GtkWidget *self,
                                                    GdkDragContext *context,
                                                    gint x,
                                                    gint y,
                                                    GtkSelectionData *selection_data,
                                                    guint info,
                                                    guint32 time,
64
                                                    gpointer data);
65
gboolean        video_widget_on_button_press_in_screen_event (VideoWidget *self,
66
                                                              GdkEventButton *event,
67
                                                              G_GNUC_UNUSED gpointer);
68 69
void            video_widget_take_snapshot (VideoWidget *self);
GdkPixbuf*      video_widget_get_snapshot  (VideoWidget *self);
70

71 72 73
G_END_DECLS

#endif /* __VIDEO_WIDGET_H__ */