#include <qtffplay.h>
Collaboration diagram for QtFFPlay:

Public Slots | |
| QImage * | grabFrame () |
Public Member Functions | |
| void | grabWindow () |
| If the video is to be played inside a window based on QT, this function will effectively "grab" that window and place the SDL overlay inside it. | |
| Uint32 | convert_yuv_rgb (Uint8 Y, Uint8 U, Uint8 V) |
| Grabs a capture from the current stream. | |
| QtFFPlay (QWidget *parent=0, Qt::WFlags flags=0) | |
| The default constructor. | |
| void | togglePause () |
| Toggles a pause of the currently playing stream (does not work currently). | |
| int | init () |
| This MUST be called before a video stream is set up and run. | |
| void | fill_rectangle (SDL_Surface *myscreen, int x, int y, int w, int h, int color) |
| void | blend_subrect (AVPicture *dst, const AVSubtitleRect *rect) |
| void | free_subpicture (SubPicture *sp) |
| void | video_image_display (VideoState *is) |
| int | compute_mod (int a, int b) |
| void | video_audio_display (VideoState *s) |
| void | video_display (VideoState *is) |
| void | schedule_refresh (VideoState *is, int delay) |
| void | stream_seek (VideoState *is, int64_t pos, int rel) |
| void | video_refresh_timer (void *opaque) |
| void | alloc_picture (void *opaque) |
| VideoState * | stream_open (QString *filename, AVInputFormat *iformat) |
| void | stream_close (VideoState *is) |
| void | stream_cycle_channel (VideoState *is, int codec_type) |
| void | toggle_full_screen (void) |
| void | toggle_pause (void) |
| void | step_to_next_frame (void) |
| void | do_exit (void) |
| void | toggle_audio_display (void) |
| void | opt_width (const char *arg) |
| void | opt_height (const char *arg) |
| void | opt_format (const char *arg) |
| void | opt_image_format (const char *arg) |
| void | opt_rtp_tcp (void) |
| void | opt_sync (const char *arg) |
| void | opt_seek (const char *arg) |
| void | opt_debug (const char *arg) |
| void | opt_vismv (const char *arg) |
| void | opt_thread_count (const char *arg) |
| void | show_help (void) |
| void | parse_arg_file (const char *filename) |
Public Attributes | |
| VideoState * | is |
| QString | input_filename |
| A string holding the name of the input file. | |
Protected Member Functions | |
| void | resizeEvent (QResizeEvent *) |
| void | paintEvent (QPaintEvent *) |
Private Member Functions | |
| void | save_pgm (unsigned char *buf, int wrap, int xsize, int ysize, char *filename) |
| A small function to save a buffer to an image in the PGM file format. | |
Private Attributes | |
| QLabel | myLabel |
| A label that can be used for displaying a QPixmap. | |
| Uint32 * | buffer_rgb |
| The buffer that holds data converted from YUV to RGB. | |
| int | buffer_init |
| A flag that keeps track of whether the buffer was malloc'd. | |
| QTimer * | mtimer |
| A timer that can be set up to periodically grab frames, for instance. | |
| int | flags |
| int | w |
| int | h |
| int | alreadyInit |
| SDL_Surface | tmpSurface |
| qtffthread | mythread |
| The thread that does all the low-level work. | |
This class interfaces with the SDL and ffmpeg libraries for video playback.
This class has an instance of qtffthread which is derived from QThread, and runs separately to decode the video and copy frame information into a buffer. This class then uses that buffer information for frame grabbing.
Several of the member functions have no documentation; this is because they were derived from ffplay, which had no documentation. Sorry.
Definition at line 28 of file qtffplay.h.
| QtFFPlay::QtFFPlay | ( | QWidget * | parent = 0, |
|
| Qt::WFlags | flags = 0 | |||
| ) |
The default constructor.
| parent | A pointer to the parent widget. | |
| flags | Flags that can be passed along to this widget related to QWidget properties. |
Definition at line 13 of file qtffplay.cpp.
References alreadyInit, and buffer_init.
| Uint32 QtFFPlay::convert_yuv_rgb | ( | Uint8 | Y, | |
| Uint8 | U, | |||
| Uint8 | V | |||
| ) |
Grabs a capture from the current stream.
In order to display a grabbed frame, it must be converted from a standard video format (YUV) to RGB (red, green, blue). This function does just that and returns the pixel value in 32-bit ARGB format (where the Alpha value is not used).
| Y | The luminance component. | |
| U | The first chrominance value. | |
| V | The second chrominance value. |
Definition at line 198 of file qtffplay.cpp.
Referenced by grabFrame().
| void QtFFPlay::grabWindow | ( | ) |
If the video is to be played inside a window based on QT, this function will effectively "grab" that window and place the SDL overlay inside it.
This doesn't need to be used necessarily.
Definition at line 26 of file qtffplay.cpp.
References flags, qtffthread::myscreen, and mythread.
| int QtFFPlay::init | ( | ) |
This MUST be called before a video stream is set up and run.
Definition at line 65 of file qtffplay.cpp.
References alreadyInit, qtffthread::EXIT_INPUT_THREAD, flags, h, input_filename, qtffthread::myscreen, mythread, show_help(), stream_open(), and w.
Referenced by frameServer::attachSource().
| void QtFFPlay::save_pgm | ( | unsigned char * | buf, | |
| int | wrap, | |||
| int | xsize, | |||
| int | ysize, | |||
| char * | filename | |||
| ) | [private] |
A small function to save a buffer to an image in the PGM file format.
This was only for testing.
Definition at line 185 of file qtffplay.cpp.
| void QtFFPlay::togglePause | ( | ) |
Toggles a pause of the currently playing stream (does not work currently).
Definition at line 46 of file qtffplay.cpp.
References mythread, and qtffthread::togglePause().
Referenced by frameServer::togglePause().
int QtFFPlay::buffer_init [private] |
A flag that keeps track of whether the buffer was malloc'd.
Definition at line 124 of file qtffplay.h.
Referenced by grabFrame(), and QtFFPlay().
Uint32* QtFFPlay::buffer_rgb [private] |
The buffer that holds data converted from YUV to RGB.
Definition at line 120 of file qtffplay.h.
Referenced by grabFrame().
| QString QtFFPlay::input_filename |
A string holding the name of the input file.
Definition at line 100 of file qtffplay.h.
Referenced by frameServer::attachSource(), init(), and parse_arg_file().
QTimer* QtFFPlay::mtimer [private] |
A timer that can be set up to periodically grab frames, for instance.
Definition at line 128 of file qtffplay.h.
QLabel QtFFPlay::myLabel [private] |
qtffthread QtFFPlay::mythread [private] |
The thread that does all the low-level work.
Definition at line 140 of file qtffplay.h.
Referenced by grabWindow(), init(), stream_open(), and togglePause().
1.4.7