LibVNCServer/LibVNCClient
Data Structures | Macros | Functions | Variables
vnc2mpg.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <signal.h>
#include <sys/time.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <rfb/rfbclient.h>
+ Include dependency graph for vnc2mpg.c:

Go to the source code of this file.

Data Structures

struct  VideoOutputStream
 

Macros

#define VNC_PIX_FMT   AV_PIX_FMT_RGB565 /* pixel format generated by VNC client */
 
#define OUTPUT_PIX_FMT   AV_PIX_FMT_YUV420P /* default pix_fmt */
 

Functions

int add_video_stream (VideoOutputStream *ost, AVFormatContext *oc, enum AVCodecID codec_id, int64_t br, int sr, int w, int h)
 
AVFrame * alloc_picture (enum AVPixelFormat pix_fmt, int width, int height)
 
int open_video (AVFormatContext *oc, VideoOutputStream *ost)
 
int write_video_frame (AVFormatContext *oc, VideoOutputStream *ost, int64_t pts)
 
int write_final_video_frame (AVFormatContext *oc, VideoOutputStream *ost)
 
void close_video_stream (VideoOutputStream *ost)
 
AVFormatContext * movie_open (char *filename, VideoOutputStream *video_st, int br, int fr, int w, int h)
 
void movie_close (AVFormatContext **ocp, VideoOutputStream *video_st)
 
void signal_handler (int signal)
 
int64_t time_to_pts (int framerate, struct timespec *start_time, struct timespec *cur_time)
 
rfbBool vnc_malloc_fb (rfbClient *client)
 
void vnc_update (rfbClient *client, int x, int y, int w, int h)
 
int main (int argc, char **argv)
 

Variables

VideoOutputStream video_st = { 0 }
 
rfbClientclient = NULL
 
rfbBool quit = FALSE
 
char * filename = NULL
 
AVFormatContext * oc = NULL
 
int bitrate = 1000000
 
int framerate = 5
 
long max_time = 0
 
struct timespec start_time cur_time
 

Macro Definition Documentation

◆ OUTPUT_PIX_FMT

#define OUTPUT_PIX_FMT   AV_PIX_FMT_YUV420P /* default pix_fmt */
Examples
vnc2mpg.c.

Definition at line 38 of file vnc2mpg.c.

◆ VNC_PIX_FMT

#define VNC_PIX_FMT   AV_PIX_FMT_RGB565 /* pixel format generated by VNC client */
Examples
vnc2mpg.c.

Definition at line 37 of file vnc2mpg.c.

Function Documentation

◆ add_video_stream()

int add_video_stream ( VideoOutputStream ost,
AVFormatContext *  oc,
enum AVCodecID  codec_id,
int64_t  br,
int  sr,
int  w,
int  h 
)
Examples
vnc2mpg.c.

Definition at line 64 of file vnc2mpg.c.

+ Here is the caller graph for this function:

◆ alloc_picture()

AVFrame* alloc_picture ( enum AVPixelFormat  pix_fmt,
int  width,
int  height 
)
Examples
vnc2mpg.c.

Definition at line 125 of file vnc2mpg.c.

+ Here is the caller graph for this function:

◆ close_video_stream()

void close_video_stream ( VideoOutputStream ost)
Examples
vnc2mpg.c.

Definition at line 256 of file vnc2mpg.c.

+ Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)
Examples
vnc2mpg.c.

Definition at line 410 of file vnc2mpg.c.

+ Here is the call graph for this function:

◆ movie_close()

void movie_close ( AVFormatContext **  ocp,
VideoOutputStream video_st 
)
Examples
vnc2mpg.c.

Definition at line 330 of file vnc2mpg.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ movie_open()

AVFormatContext* movie_open ( char *  filename,
VideoOutputStream video_st,
int  br,
int  fr,
int  w,
int  h 
)
Examples
vnc2mpg.c.

Definition at line 268 of file vnc2mpg.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open_video()

int open_video ( AVFormatContext *  oc,
VideoOutputStream ost 
)
Examples
vnc2mpg.c.

Definition at line 146 of file vnc2mpg.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ signal_handler()

void signal_handler ( int  signal)
Examples
vnc2mpg.c.

Definition at line 368 of file vnc2mpg.c.

+ Here is the caller graph for this function:

◆ time_to_pts()

int64_t time_to_pts ( int  framerate,
struct timespec *  start_time,
struct timespec *  cur_time 
)
Examples
vnc2mpg.c.

Definition at line 373 of file vnc2mpg.c.

+ Here is the caller graph for this function:

◆ vnc_malloc_fb()

rfbBool vnc_malloc_fb ( rfbClient client)
Examples
vnc2mpg.c.

Definition at line 385 of file vnc2mpg.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnc_update()

void vnc_update ( rfbClient client,
int  x,
int  y,
int  w,
int  h 
)
Examples
vnc2mpg.c.

Definition at line 405 of file vnc2mpg.c.

+ Here is the caller graph for this function:

◆ write_final_video_frame()

int write_final_video_frame ( AVFormatContext *  oc,
VideoOutputStream ost 
)
Examples
vnc2mpg.c.

Definition at line 231 of file vnc2mpg.c.

+ Here is the caller graph for this function:

◆ write_video_frame()

int write_video_frame ( AVFormatContext *  oc,
VideoOutputStream ost,
int64_t  pts 
)
Examples
vnc2mpg.c.

Definition at line 195 of file vnc2mpg.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ bitrate

int bitrate = 1000000
Examples
vnc2mpg.c.

Definition at line 362 of file vnc2mpg.c.

◆ client

rfbClient* client = NULL
Examples
SDLvncviewer.c, ppmtest.c, and vnc2mpg.c.

Definition at line 358 of file vnc2mpg.c.

◆ cur_time

struct timespec start_time cur_time
Examples
vnc2mpg.c.

Definition at line 364 of file vnc2mpg.c.

◆ filename

char* filename = NULL
Examples
vnc2mpg.c.

Definition at line 360 of file vnc2mpg.c.

◆ framerate

int framerate = 5
Examples
vnc2mpg.c.

Definition at line 363 of file vnc2mpg.c.

◆ max_time

long max_time = 0
Examples
vnc2mpg.c.

Definition at line 364 of file vnc2mpg.c.

◆ oc

AVFormatContext* oc = NULL
Examples
vnc2mpg.c.

Definition at line 361 of file vnc2mpg.c.

◆ quit

rfbBool quit = FALSE
Examples
vnc2mpg.c.

Definition at line 359 of file vnc2mpg.c.

◆ video_st

VideoOutputStream video_st = { 0 }
Examples
vnc2mpg.c.

Definition at line 357 of file vnc2mpg.c.