Revision 616deed2

View differences:

libavcodec/libxvidff.c
44 44
 * Structure for the private Xvid context.
45 45
 * This stores all the private context for the codec.
46 46
 */
47
typedef struct xvid_context {
47
struct xvid_context {
48 48
    void *encoder_handle;          /** Handle for Xvid encoder */
49 49
    int xsize, ysize;              /** Frame size */
50 50
    int vop_flags;                 /** VOP flags for Xvid encoder */
......
58 58
    char *twopassfile;             /** second pass temp file name */
59 59
    unsigned char *intra_matrix;   /** P-Frame Quant Matrix */
60 60
    unsigned char *inter_matrix;   /** I-Frame Quant Matrix */
61
} xvid_context_t;
61
};
62 62

  
63 63
/**
64 64
 * Structure for the private first-pass plugin.
65 65
 */
66
typedef struct xvid_ff_pass1 {
66
struct xvid_ff_pass1 {
67 67
    int     version;                /** Xvid version */
68
    xvid_context_t *context;        /** Pointer to private context */
69
} xvid_ff_pass1_t;
68
    struct xvid_context *context;        /** Pointer to private context */
69
};
70 70

  
71 71
/* Prototypes - See function implementation for details */
72 72
int xvid_strip_vol_header(AVCodecContext *avctx, unsigned char *frame, unsigned int header_len, unsigned int frame_len);
......
84 84
av_cold int ff_xvid_encode_init(AVCodecContext *avctx)  {
85 85
    int xerr, i;
86 86
    int xvid_flags = avctx->flags;
87
    xvid_context_t *x = avctx->priv_data;
87
    struct xvid_context *x = avctx->priv_data;
88 88
    uint16_t *intra, *inter;
89 89
    int fd;
90 90

  
91 91
    xvid_plugin_single_t single;
92
    xvid_ff_pass1_t rc2pass1;
92
    struct xvid_ff_pass1 rc2pass1;
93 93
    xvid_plugin_2pass2_t rc2pass2;
94 94
    xvid_gbl_init_t xvid_gbl_init;
95 95
    xvid_enc_create_t xvid_enc_create;
......
208 208
    x->twopassfile = NULL;
209 209

  
210 210
    if( xvid_flags & CODEC_FLAG_PASS1 ) {
211
        memset(&rc2pass1, 0, sizeof(xvid_ff_pass1_t));
211
        memset(&rc2pass1, 0, sizeof(struct xvid_ff_pass1));
212 212
        rc2pass1.version = XVID_VERSION;
213 213
        rc2pass1.context = x;
214 214
        x->twopassbuffer = av_malloc(BUFFER_SIZE);
......
370 370
                         unsigned char *frame, int buf_size, void *data) {
371 371
    int xerr, i;
372 372
    char *tmp;
373
    xvid_context_t *x = avctx->priv_data;
373
    struct xvid_context *x = avctx->priv_data;
374 374
    AVFrame *picture = data;
375 375
    AVFrame *p = &(x->encoded_picture);
376 376

  
......
475 475
 * @return Returns 0, success guaranteed
476 476
 */
477 477
av_cold int ff_xvid_encode_close(AVCodecContext *avctx) {
478
    xvid_context_t *x = avctx->priv_data;
478
    struct xvid_context *x = avctx->priv_data;
479 479

  
480 480
    xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);
481 481

  
......
616 616
 */
617 617
static int xvid_ff_2pass_create(xvid_plg_create_t * param,
618 618
                                void ** handle) {
619
    xvid_ff_pass1_t *x = (xvid_ff_pass1_t *)param->param;
619
    struct xvid_ff_pass1 *x = (struct xvid_ff_pass1 *)param->param;
620 620
    char *log = x->context->twopassbuffer;
621 621

  
622 622
    /* Do a quick bounds check */
......
645 645
 * @param param Destrooy context
646 646
 * @return Returns 0, success guaranteed
647 647
 */
648
static int xvid_ff_2pass_destroy(xvid_context_t *ref,
648
static int xvid_ff_2pass_destroy(struct xvid_context *ref,
649 649
                                xvid_plg_destroy_t *param) {
650 650
    /* Currently cannot think of anything to do on destruction */
651 651
    /* Still, the framework should be here for reference/use */
......
661 661
 * @param param Frame data
662 662
 * @return Returns 0, success guaranteed
663 663
 */
664
static int xvid_ff_2pass_before(xvid_context_t *ref,
664
static int xvid_ff_2pass_before(struct xvid_context *ref,
665 665
                                xvid_plg_data_t *param) {
666 666
    int motion_remove;
667 667
    int motion_replacements;
......
704 704
 * @param param Statistic data
705 705
 * @return Returns XVID_ERR_xxxx on failure, or 0 on success
706 706
 */
707
static int xvid_ff_2pass_after(xvid_context_t *ref,
707
static int xvid_ff_2pass_after(struct xvid_context *ref,
708 708
                                xvid_plg_data_t *param) {
709 709
    char *log = ref->twopassbuffer;
710 710
    char *frame_types = " ipbs";
......
770 770
    "libxvid",
771 771
    CODEC_TYPE_VIDEO,
772 772
    CODEC_ID_XVID,
773
    sizeof(xvid_context_t),
773
    sizeof(struct xvid_context),
774 774
    ff_xvid_encode_init,
775 775
    ff_xvid_encode_frame,
776 776
    ff_xvid_encode_close,
libavdevice/x11grab.c
55 55
/**
56 56
 * X11 Device Demuxer context
57 57
 */
58
typedef struct x11_grab_s
58
struct x11_grab
59 59
{
60 60
    int frame_size;          /**< Size in bytes of a grabbed frame */
61 61
    AVRational time_base;    /**< Time base */
......
71 71
    int use_shm;             /**< !0 when using XShm extension */
72 72
    XShmSegmentInfo shminfo; /**< When using XShm, keeps track of XShm infos */
73 73
    int mouse_warning_shown;
74
} x11_grab_t;
74
};
75 75

  
76 76
/**
77 77
 * Initializes the x11 grab device demuxer (public device demuxer API).
......
87 87
static int
88 88
x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
89 89
{
90
    x11_grab_t *x11grab = s1->priv_data;
90
    struct x11_grab *x11grab = s1->priv_data;
91 91
    Display *dpy;
92 92
    AVStream *st = NULL;
93 93
    int input_pixfmt;
......
259 259
    if (XQueryPointer(dpy, mrootwindow, &mrootwindow, &childwindow,
260 260
                      x, y, &dummy, &dummy, (unsigned int*)&dummy)) {
261 261
    } else {
262
        x11_grab_t *s = s1->priv_data;
262
        struct x11_grab *s = s1->priv_data;
263 263
        if (!s->mouse_warning_shown) {
264 264
            av_log(s1, AV_LOG_INFO, "couldn't find mouse pointer\n");
265 265
            s->mouse_warning_shown = 1;
......
306 306
 * @param y Mouse pointer coordinate
307 307
 */
308 308
static void
309
paint_mouse_pointer(XImage *image, x11_grab_t *s, int x, int y)
309
paint_mouse_pointer(XImage *image, struct x11_grab *s, int x, int y)
310 310
{
311 311
    /* 16x20x1bpp bitmap for the black channel of the mouse pointer */
312 312
    static const uint16_t const mousePointerBlack[] =
......
431 431
static int
432 432
x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
433 433
{
434
    x11_grab_t *s = s1->priv_data;
434
    struct x11_grab *s = s1->priv_data;
435 435
    Display *dpy = s->dpy;
436 436
    XImage *image = s->image;
437 437
    int x_off = s->x_off;
......
495 495
static int
496 496
x11grab_read_close(AVFormatContext *s1)
497 497
{
498
    x11_grab_t *x11grab = s1->priv_data;
498
    struct x11_grab *x11grab = s1->priv_data;
499 499

  
500 500
    /* Detach cleanly from shared mem */
501 501
    if (x11grab->use_shm) {
......
520 520
{
521 521
    "x11grab",
522 522
    NULL_IF_CONFIG_SMALL("X11grab"),
523
    sizeof(x11_grab_t),
523
    sizeof(struct x11_grab),
524 524
    NULL,
525 525
    x11grab_read_header,
526 526
    x11grab_read_packet,

Also available in: Unified diff