1cabdff1aSopenharmony_ci/* 2cabdff1aSopenharmony_ci * HTTP definitions 3cabdff1aSopenharmony_ci * Copyright (c) 2010 Josh Allmann 4cabdff1aSopenharmony_ci * 5cabdff1aSopenharmony_ci * This file is part of FFmpeg. 6cabdff1aSopenharmony_ci * 7cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or 8cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public 9cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either 10cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version. 11cabdff1aSopenharmony_ci * 12cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful, 13cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 14cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15cabdff1aSopenharmony_ci * Lesser General Public License for more details. 16cabdff1aSopenharmony_ci * 17cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public 18cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software 19cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20cabdff1aSopenharmony_ci */ 21cabdff1aSopenharmony_ci 22cabdff1aSopenharmony_ci#ifndef AVFORMAT_HTTP_H 23cabdff1aSopenharmony_ci#define AVFORMAT_HTTP_H 24cabdff1aSopenharmony_ci 25cabdff1aSopenharmony_ci#include "url.h" 26cabdff1aSopenharmony_ci 27cabdff1aSopenharmony_ci#define HTTP_HEADERS_SIZE 4096 28cabdff1aSopenharmony_ci 29cabdff1aSopenharmony_ci/** 30cabdff1aSopenharmony_ci * Initialize the authentication state based on another HTTP URLContext. 31cabdff1aSopenharmony_ci * This can be used to pre-initialize the authentication parameters if 32cabdff1aSopenharmony_ci * they are known beforehand, to avoid having to do an initial failing 33cabdff1aSopenharmony_ci * request just to get the parameters. 34cabdff1aSopenharmony_ci * 35cabdff1aSopenharmony_ci * @param dest URL context whose authentication state gets updated 36cabdff1aSopenharmony_ci * @param src URL context whose authentication state gets copied 37cabdff1aSopenharmony_ci */ 38cabdff1aSopenharmony_civoid ff_http_init_auth_state(URLContext *dest, const URLContext *src); 39cabdff1aSopenharmony_ci 40cabdff1aSopenharmony_ci/** 41cabdff1aSopenharmony_ci * Send a new HTTP request, reusing the old connection. 42cabdff1aSopenharmony_ci * 43cabdff1aSopenharmony_ci * @param h pointer to the resource 44cabdff1aSopenharmony_ci * @param uri uri used to perform the request 45cabdff1aSopenharmony_ci * @return a negative value if an error condition occurred, 0 46cabdff1aSopenharmony_ci * otherwise 47cabdff1aSopenharmony_ci */ 48cabdff1aSopenharmony_ciint ff_http_do_new_request(URLContext *h, const char *uri); 49cabdff1aSopenharmony_ci 50cabdff1aSopenharmony_ci/** 51cabdff1aSopenharmony_ci * Send a new HTTP request, reusing the old connection. 52cabdff1aSopenharmony_ci * 53cabdff1aSopenharmony_ci * @param h pointer to the resource 54cabdff1aSopenharmony_ci * @param uri uri used to perform the request 55cabdff1aSopenharmony_ci * @param options A dictionary filled with HTTP options. On return 56cabdff1aSopenharmony_ci * this parameter will be destroyed and replaced with a dict containing options 57cabdff1aSopenharmony_ci * that were not found. May be NULL. 58cabdff1aSopenharmony_ci * @return a negative value if an error condition occurred, 0 59cabdff1aSopenharmony_ci * otherwise 60cabdff1aSopenharmony_ci */ 61cabdff1aSopenharmony_ciint ff_http_do_new_request2(URLContext *h, const char *uri, AVDictionary **options); 62cabdff1aSopenharmony_ci 63cabdff1aSopenharmony_ciint ff_http_averror(int status_code, int default_averror); 64cabdff1aSopenharmony_ci 65cabdff1aSopenharmony_ci#endif /* AVFORMAT_HTTP_H */ 66