lavf: use designated initializers for all protocols
authorAnton Khirnov <anton@khirnov.net>
Fri, 8 Apr 2011 05:41:47 +0000 (07:41 +0200)
committerAnton Khirnov <anton@khirnov.net>
Fri, 8 Apr 2011 09:08:26 +0000 (11:08 +0200)
This is more readable and makes it easier to reorder URLProtocol
members.

libavformat/applehttpproto.c
libavformat/concat.c
libavformat/file.c
libavformat/gopher.c
libavformat/http.c
libavformat/librtmp.c
libavformat/mmst.c
libavformat/rtmpproto.c
libavformat/rtpproto.c
libavformat/tcp.c
libavformat/udp.c

index 52645f7..8842bd4 100644 (file)
@@ -298,11 +298,9 @@ static int applehttp_close(URLContext *h)
 }
 
 URLProtocol ff_applehttp_protocol = {
-    "applehttp",
-    applehttp_open,
-    applehttp_read,
-    NULL, /* write */
-    NULL, /* seek */
-    applehttp_close,
-    .flags = URL_PROTOCOL_FLAG_NESTED_SCHEME,
+    .name      = "applehttp",
+    .url_open  = applehttp_open,
+    .url_read  = applehttp_read,
+    .url_close = applehttp_close,
+    .flags     = URL_PROTOCOL_FLAG_NESTED_SCHEME,
 };
index dbacc69..da9bee2 100644 (file)
@@ -190,10 +190,9 @@ static int64_t concat_seek(URLContext *h, int64_t pos, int whence)
 }
 
 URLProtocol ff_concat_protocol = {
-    "concat",
-    concat_open,
-    concat_read,
-    NULL,
-    concat_seek,
-    concat_close,
+    .name      = "concat",
+    .url_open  = concat_open,
+    .url_read  = concat_read,
+    .url_seek  = concat_seek,
+    .url_close = concat_close,
 };
index 729061a..3293a53 100644 (file)
@@ -95,12 +95,12 @@ static int file_close(URLContext *h)
 }
 
 URLProtocol ff_file_protocol = {
-    "file",
-    file_open,
-    file_read,
-    file_write,
-    file_seek,
-    file_close,
+    .name                = "file",
+    .url_open            = file_open,
+    .url_read            = file_read,
+    .url_write           = file_write,
+    .url_seek            = file_seek,
+    .url_close           = file_close,
     .url_get_file_handle = file_get_handle,
 };
 
@@ -131,10 +131,10 @@ static int pipe_open(URLContext *h, const char *filename, int flags)
 }
 
 URLProtocol ff_pipe_protocol = {
-    "pipe",
-    pipe_open,
-    file_read,
-    file_write,
+    .name                = "pipe",
+    .url_open            = pipe_open,
+    .url_read            = file_read,
+    .url_write           = file_write,
     .url_get_file_handle = file_get_handle,
 };
 
index cfc4424..cfc07e7 100644 (file)
@@ -121,10 +121,9 @@ static int gopher_read(URLContext *h, uint8_t *buf, int size)
 
 
 URLProtocol ff_gopher_protocol = {
-    "gopher",
-    gopher_open,
-    gopher_read,
-    gopher_write,
-    NULL, /*seek*/
-    gopher_close,
+    .name      = "gopher",
+    .url_open  = gopher_open,
+    .url_read  = gopher_read,
+    .url_write = gopher_write,
+    .url_close = gopher_close,
 };
index 8d20527..bcfce80 100644 (file)
@@ -505,13 +505,13 @@ http_get_file_handle(URLContext *h)
 }
 
 URLProtocol ff_http_protocol = {
-    "http",
-    http_open,
-    http_read,
-    http_write,
-    http_seek,
-    http_close,
+    .name                = "http",
+    .url_open            = http_open,
+    .url_read            = http_read,
+    .url_write           = http_write,
+    .url_seek            = http_seek,
+    .url_close           = http_close,
     .url_get_file_handle = http_get_file_handle,
-    .priv_data_size = sizeof(HTTPContext),
-    .priv_data_class = &httpcontext_class,
+    .priv_data_size      = sizeof(HTTPContext),
+    .priv_data_class     = &httpcontext_class,
 };
index f980402..5770e59 100644 (file)
@@ -158,66 +158,56 @@ static int rtmp_get_file_handle(URLContext *s)
 }
 
 URLProtocol ff_rtmp_protocol = {
-    "rtmp",
-    rtmp_open,
-    rtmp_read,
-    rtmp_write,
-    NULL,                   /* seek */
-    rtmp_close,
-    NULL,                   /* next */
-    rtmp_read_pause,
-    rtmp_read_seek,
-    rtmp_get_file_handle
+    .name                = "rtmp",
+    .url_open            = rtmp_open,
+    .url_read            = rtmp_read,
+    .url_write           = rtmp_write,
+    .url_close           = rtmp_close,
+    .url_read_pause      = rtmp_read_pause,
+    .url_read_seek       = rtmp_read_seek,
+    .url_get_file_handle = rtmp_get_file_handle
 };
 
 URLProtocol ff_rtmpt_protocol = {
-    "rtmpt",
-    rtmp_open,
-    rtmp_read,
-    rtmp_write,
-    NULL,                   /* seek */
-    rtmp_close,
-    NULL,                   /* next */
-    rtmp_read_pause,
-    rtmp_read_seek,
-    rtmp_get_file_handle
+    .name                = "rtmpt",
+    .url_open            = rtmp_open,
+    .url_read            = rtmp_read,
+    .url_write           = rtmp_write,
+    .url_close           = rtmp_close,
+    .url_read_pause      = rtmp_read_pause,
+    .url_read_seek       = rtmp_read_seek,
+    .url_get_file_handle = rtmp_get_file_handle
 };
 
 URLProtocol ff_rtmpe_protocol = {
-    "rtmpe",
-    rtmp_open,
-    rtmp_read,
-    rtmp_write,
-    NULL,                   /* seek */
-    rtmp_close,
-    NULL,                   /* next */
-    rtmp_read_pause,
-    rtmp_read_seek,
-    rtmp_get_file_handle
+    .name                = "rtmpe",
+    .url_open            = rtmp_open,
+    .url_read            = rtmp_read,
+    .url_write           = rtmp_write,
+    .url_close           = rtmp_close,
+    .url_read_pause      = rtmp_read_pause,
+    .url_read_seek       = rtmp_read_seek,
+    .url_get_file_handle = rtmp_get_file_handle
 };
 
 URLProtocol ff_rtmpte_protocol = {
-    "rtmpte",
-    rtmp_open,
-    rtmp_read,
-    rtmp_write,
-    NULL,                   /* seek */
-    rtmp_close,
-    NULL,                   /* next */
-    rtmp_read_pause,
-    rtmp_read_seek,
-    rtmp_get_file_handle
+    .name                = "rtmpte",
+    .url_open            = rtmp_open,
+    .url_read            = rtmp_read,
+    .url_write           = rtmp_write,
+    .url_close           = rtmp_close,
+    .url_read_pause      = rtmp_read_pause,
+    .url_read_seek       = rtmp_read_seek,
+    .url_get_file_handle = rtmp_get_file_handle
 };
 
 URLProtocol ff_rtmps_protocol = {
-    "rtmps",
-    rtmp_open,
-    rtmp_read,
-    rtmp_write,
-    NULL,                   /* seek */
-    rtmp_close,
-    NULL,                   /* next */
-    rtmp_read_pause,
-    rtmp_read_seek,
-    rtmp_get_file_handle
+    .name                = "rtmps",
+    .url_open            = rtmp_open,
+    .url_read            = rtmp_read,
+    .url_write           = rtmp_write,
+    .url_close           = rtmp_close,
+    .url_read_pause      = rtmp_read_pause,
+    .url_read_seek       = rtmp_read_seek,
+    .url_get_file_handle = rtmp_get_file_handle
 };
index 30219dc..a3f2609 100644 (file)
@@ -623,10 +623,8 @@ static int mms_read(URLContext *h, uint8_t *buf, int size)
 }
 
 URLProtocol ff_mmst_protocol = {
-    "mmst",
-    mms_open,
-    mms_read,
-    NULL, // write
-    NULL, // seek
-    mms_close,
+    .name      = "mmst",
+    .url_open  = mms_open,
+    .url_read  = mms_read,
+    .url_close = mms_close,
 };
index f151984..9fc5196 100644 (file)
@@ -991,10 +991,9 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
 }
 
 URLProtocol ff_rtmp_protocol = {
-    "rtmp",
-    rtmp_open,
-    rtmp_read,
-    rtmp_write,
-    NULL, /* seek */
-    rtmp_close,
+    .name      = "rtmp",
+    .url_open  = rtmp_open,
+    .url_read  = rtmp_read,
+    .url_write = rtmp_write,
+    .url_close = rtmp_close,
 };
index 5ac0e1b..b92b2e7 100644 (file)
@@ -355,11 +355,10 @@ int rtp_get_rtcp_file_handle(URLContext *h) {
 }
 
 URLProtocol ff_rtp_protocol = {
-    "rtp",
-    rtp_open,
-    rtp_read,
-    rtp_write,
-    NULL, /* seek */
-    rtp_close,
+    .name                = "rtp",
+    .url_open            = rtp_open,
+    .url_read            = rtp_read,
+    .url_write           = rtp_write,
+    .url_close           = rtp_close,
     .url_get_file_handle = rtp_get_file_handle,
 };
index 8e380ac..0cb3ae3 100644 (file)
@@ -195,11 +195,10 @@ static int tcp_get_file_handle(URLContext *h)
 }
 
 URLProtocol ff_tcp_protocol = {
-    "tcp",
-    tcp_open,
-    tcp_read,
-    tcp_write,
-    NULL, /* seek */
-    tcp_close,
+    .name                = "tcp",
+    .url_open            = tcp_open,
+    .url_read            = tcp_read,
+    .url_write           = tcp_write,
+    .url_close           = tcp_close,
     .url_get_file_handle = tcp_get_file_handle,
 };
index 07d1775..b881ff9 100644 (file)
@@ -489,11 +489,10 @@ static int udp_close(URLContext *h)
 }
 
 URLProtocol ff_udp_protocol = {
-    "udp",
-    udp_open,
-    udp_read,
-    udp_write,
-    NULL, /* seek */
-    udp_close,
+    .name                = "udp",
+    .url_open            = udp_open,
+    .url_read            = udp_read,
+    .url_write           = udp_write,
+    .url_close           = udp_close,
     .url_get_file_handle = udp_get_file_handle,
 };