lavf: use designated initializers for all protocols

This is more readable and makes it easier to reorder URLProtocol
members.
oldabi
Anton Khirnov 14 years ago
parent a6aa7a1a14
commit f35ff97f2e
  1. 10
      libavformat/applehttpproto.c
  2. 11
      libavformat/concat.c
  3. 20
      libavformat/file.c
  4. 11
      libavformat/gopher.c
  5. 12
      libavformat/http.c
  6. 90
      libavformat/librtmp.c
  7. 10
      libavformat/mmst.c
  8. 11
      libavformat/rtmpproto.c
  9. 11
      libavformat/rtpproto.c
  10. 11
      libavformat/tcp.c
  11. 11
      libavformat/udp.c

@ -298,11 +298,9 @@ static int applehttp_close(URLContext *h)
} }
URLProtocol ff_applehttp_protocol = { URLProtocol ff_applehttp_protocol = {
"applehttp", .name = "applehttp",
applehttp_open, .url_open = applehttp_open,
applehttp_read, .url_read = applehttp_read,
NULL, /* write */ .url_close = applehttp_close,
NULL, /* seek */
applehttp_close,
.flags = URL_PROTOCOL_FLAG_NESTED_SCHEME, .flags = URL_PROTOCOL_FLAG_NESTED_SCHEME,
}; };

@ -190,10 +190,9 @@ static int64_t concat_seek(URLContext *h, int64_t pos, int whence)
} }
URLProtocol ff_concat_protocol = { URLProtocol ff_concat_protocol = {
"concat", .name = "concat",
concat_open, .url_open = concat_open,
concat_read, .url_read = concat_read,
NULL, .url_seek = concat_seek,
concat_seek, .url_close = concat_close,
concat_close,
}; };

@ -95,12 +95,12 @@ static int file_close(URLContext *h)
} }
URLProtocol ff_file_protocol = { URLProtocol ff_file_protocol = {
"file", .name = "file",
file_open, .url_open = file_open,
file_read, .url_read = file_read,
file_write, .url_write = file_write,
file_seek, .url_seek = file_seek,
file_close, .url_close = file_close,
.url_get_file_handle = file_get_handle, .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 = { URLProtocol ff_pipe_protocol = {
"pipe", .name = "pipe",
pipe_open, .url_open = pipe_open,
file_read, .url_read = file_read,
file_write, .url_write = file_write,
.url_get_file_handle = file_get_handle, .url_get_file_handle = file_get_handle,
}; };

@ -121,10 +121,9 @@ static int gopher_read(URLContext *h, uint8_t *buf, int size)
URLProtocol ff_gopher_protocol = { URLProtocol ff_gopher_protocol = {
"gopher", .name = "gopher",
gopher_open, .url_open = gopher_open,
gopher_read, .url_read = gopher_read,
gopher_write, .url_write = gopher_write,
NULL, /*seek*/ .url_close = gopher_close,
gopher_close,
}; };

@ -505,12 +505,12 @@ http_get_file_handle(URLContext *h)
} }
URLProtocol ff_http_protocol = { URLProtocol ff_http_protocol = {
"http", .name = "http",
http_open, .url_open = http_open,
http_read, .url_read = http_read,
http_write, .url_write = http_write,
http_seek, .url_seek = http_seek,
http_close, .url_close = http_close,
.url_get_file_handle = http_get_file_handle, .url_get_file_handle = http_get_file_handle,
.priv_data_size = sizeof(HTTPContext), .priv_data_size = sizeof(HTTPContext),
.priv_data_class = &httpcontext_class, .priv_data_class = &httpcontext_class,

@ -158,66 +158,56 @@ static int rtmp_get_file_handle(URLContext *s)
} }
URLProtocol ff_rtmp_protocol = { URLProtocol ff_rtmp_protocol = {
"rtmp", .name = "rtmp",
rtmp_open, .url_open = rtmp_open,
rtmp_read, .url_read = rtmp_read,
rtmp_write, .url_write = rtmp_write,
NULL, /* seek */ .url_close = rtmp_close,
rtmp_close, .url_read_pause = rtmp_read_pause,
NULL, /* next */ .url_read_seek = rtmp_read_seek,
rtmp_read_pause, .url_get_file_handle = rtmp_get_file_handle
rtmp_read_seek,
rtmp_get_file_handle
}; };
URLProtocol ff_rtmpt_protocol = { URLProtocol ff_rtmpt_protocol = {
"rtmpt", .name = "rtmpt",
rtmp_open, .url_open = rtmp_open,
rtmp_read, .url_read = rtmp_read,
rtmp_write, .url_write = rtmp_write,
NULL, /* seek */ .url_close = rtmp_close,
rtmp_close, .url_read_pause = rtmp_read_pause,
NULL, /* next */ .url_read_seek = rtmp_read_seek,
rtmp_read_pause, .url_get_file_handle = rtmp_get_file_handle
rtmp_read_seek,
rtmp_get_file_handle
}; };
URLProtocol ff_rtmpe_protocol = { URLProtocol ff_rtmpe_protocol = {
"rtmpe", .name = "rtmpe",
rtmp_open, .url_open = rtmp_open,
rtmp_read, .url_read = rtmp_read,
rtmp_write, .url_write = rtmp_write,
NULL, /* seek */ .url_close = rtmp_close,
rtmp_close, .url_read_pause = rtmp_read_pause,
NULL, /* next */ .url_read_seek = rtmp_read_seek,
rtmp_read_pause, .url_get_file_handle = rtmp_get_file_handle
rtmp_read_seek,
rtmp_get_file_handle
}; };
URLProtocol ff_rtmpte_protocol = { URLProtocol ff_rtmpte_protocol = {
"rtmpte", .name = "rtmpte",
rtmp_open, .url_open = rtmp_open,
rtmp_read, .url_read = rtmp_read,
rtmp_write, .url_write = rtmp_write,
NULL, /* seek */ .url_close = rtmp_close,
rtmp_close, .url_read_pause = rtmp_read_pause,
NULL, /* next */ .url_read_seek = rtmp_read_seek,
rtmp_read_pause, .url_get_file_handle = rtmp_get_file_handle
rtmp_read_seek,
rtmp_get_file_handle
}; };
URLProtocol ff_rtmps_protocol = { URLProtocol ff_rtmps_protocol = {
"rtmps", .name = "rtmps",
rtmp_open, .url_open = rtmp_open,
rtmp_read, .url_read = rtmp_read,
rtmp_write, .url_write = rtmp_write,
NULL, /* seek */ .url_close = rtmp_close,
rtmp_close, .url_read_pause = rtmp_read_pause,
NULL, /* next */ .url_read_seek = rtmp_read_seek,
rtmp_read_pause, .url_get_file_handle = rtmp_get_file_handle
rtmp_read_seek,
rtmp_get_file_handle
}; };

@ -623,10 +623,8 @@ static int mms_read(URLContext *h, uint8_t *buf, int size)
} }
URLProtocol ff_mmst_protocol = { URLProtocol ff_mmst_protocol = {
"mmst", .name = "mmst",
mms_open, .url_open = mms_open,
mms_read, .url_read = mms_read,
NULL, // write .url_close = mms_close,
NULL, // seek
mms_close,
}; };

@ -991,10 +991,9 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
} }
URLProtocol ff_rtmp_protocol = { URLProtocol ff_rtmp_protocol = {
"rtmp", .name = "rtmp",
rtmp_open, .url_open = rtmp_open,
rtmp_read, .url_read = rtmp_read,
rtmp_write, .url_write = rtmp_write,
NULL, /* seek */ .url_close = rtmp_close,
rtmp_close,
}; };

@ -355,11 +355,10 @@ int rtp_get_rtcp_file_handle(URLContext *h) {
} }
URLProtocol ff_rtp_protocol = { URLProtocol ff_rtp_protocol = {
"rtp", .name = "rtp",
rtp_open, .url_open = rtp_open,
rtp_read, .url_read = rtp_read,
rtp_write, .url_write = rtp_write,
NULL, /* seek */ .url_close = rtp_close,
rtp_close,
.url_get_file_handle = rtp_get_file_handle, .url_get_file_handle = rtp_get_file_handle,
}; };

@ -195,11 +195,10 @@ static int tcp_get_file_handle(URLContext *h)
} }
URLProtocol ff_tcp_protocol = { URLProtocol ff_tcp_protocol = {
"tcp", .name = "tcp",
tcp_open, .url_open = tcp_open,
tcp_read, .url_read = tcp_read,
tcp_write, .url_write = tcp_write,
NULL, /* seek */ .url_close = tcp_close,
tcp_close,
.url_get_file_handle = tcp_get_file_handle, .url_get_file_handle = tcp_get_file_handle,
}; };

@ -489,11 +489,10 @@ static int udp_close(URLContext *h)
} }
URLProtocol ff_udp_protocol = { URLProtocol ff_udp_protocol = {
"udp", .name = "udp",
udp_open, .url_open = udp_open,
udp_read, .url_read = udp_read,
udp_write, .url_write = udp_write,
NULL, /* seek */ .url_close = udp_close,
udp_close,
.url_get_file_handle = udp_get_file_handle, .url_get_file_handle = udp_get_file_handle,
}; };

Loading…
Cancel
Save