vlcwindowless_base.h 3.02 KB
Newer Older
1
/*****************************************************************************
2
 * vlcwindowless_base.h: window-less base class for the VLC plugin
3
 *****************************************************************************
4
 * Copyright (C) 2012-2013 VLC Authors and VideoLAN
5 6
 * $Id$
 *
7
 * Authors: Sergey Radionov <rsatom@gmail.com>
8
 *          Cheng Sun <chengsun9@gmail.com>
9
 *          Jean-Baptiste Kempf <jb@videolan.org>
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
 *
 * 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 2 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.
 *****************************************************************************/

/*******************************************************************************
 * Instance state information about the plugin.
 ******************************************************************************/
#ifndef __VLCWINDOWLESS_BASE_H__
#define __VLCWINDOWLESS_BASE_H__

#include "vlcplugin_base.h"

#ifdef XP_MACOSX
const char DEF_CHROMA[] = "RGBA";
#else
const char DEF_CHROMA[] = "RV32";
#endif
enum{
    DEF_PIXEL_BYTES = 4
};

class VlcWindowlessBase : public VlcPluginBase
{
public:
    VlcWindowlessBase(NPP, NPuint16_t);

    //for libvlc_video_set_format_callbacks
    unsigned video_format_cb(char *chroma,
                             unsigned *width, unsigned *height,
                             unsigned *pitches, unsigned *lines);
    void video_cleanup_cb();
    //end (for libvlc_video_set_format_callbacks)

    //for libvlc_video_set_callbacks
    void* video_lock_cb(void **planes);
57
    virtual void video_display_cb(void *picture);
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
    //end (for libvlc_video_set_callbacks)

    static void invalidate_window_proxy(void *opaque)
        { reinterpret_cast<VlcWindowlessBase*>(opaque)->invalidate_window(); }
    void invalidate_window();

    void set_player_window();


    bool create_windows() { return true; }
    bool resize_windows() { return true; }
    bool destroy_windows() { return true; }

    void toggle_fullscreen() { /* STUB */ }
    void set_fullscreen( int ) { /* STUB */ }
73
    bool get_fullscreen() { return false; }
74 75 76 77 78 79 80 81 82

    void set_toolbar_visible(bool)  { /* STUB */ }
    bool get_toolbar_visible()  { return false; }
    void update_controls()      {/* STUB */}
    void popup_menu()           {/* STUB */}

protected:
    std::vector<char> m_frame_buf;
    unsigned int m_media_width;
83
    unsigned int m_media_source_width;
84
    unsigned int m_media_height;
85
    unsigned int m_media_source_height;
86 87
};
#endif