Revision c6fa36cf libavformat/mpjpeg.c

View differences:

libavformat/mpjpeg.c
65 65
    mpjpeg_write_trailer,
66 66
};
67 67

  
68

  
69
/*************************************/
70
/* single frame JPEG */
71

  
72
static int single_jpeg_write_header(AVFormatContext *s)
73
{
74
    return 0;
75
}
76

  
77
static int single_jpeg_write_packet(AVFormatContext *s, AVPacket *pkt)
78
{
79
    put_buffer(&s->pb, pkt->data, pkt->size);
80
    put_flush_packet(&s->pb);
81
    return 1; /* no more data can be sent */
82
}
83

  
84
static int single_jpeg_write_trailer(AVFormatContext *s)
85
{
86
    return 0;
87
}
88

  
89
static AVOutputFormat single_jpeg_format = {
90
    "singlejpeg",
91
    "single JPEG image",
92
    "image/jpeg",
93
    NULL, /* note: no extension to favorize jpeg multiple images match */
94
    0,
95
    CODEC_ID_NONE,
96
    CODEC_ID_MJPEG,
97
    single_jpeg_write_header,
98
    single_jpeg_write_packet,
99
    single_jpeg_write_trailer,
100
};
101

  
102 68
int jpeg_init(void)
103 69
{
104 70
    av_register_output_format(&mpjpeg_format);
105
    av_register_output_format(&single_jpeg_format);
106 71
    return 0;
107 72
}
108 73
#endif //CONFIG_ENCODERS

Also available in: Unified diff