mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
support push flv stream over HTTP POST to SRS.
This commit is contained in:
parent
77ee2400df
commit
c617d2aaa5
4 changed files with 21 additions and 4 deletions
|
@ -175,6 +175,17 @@ int SrsDynamicHttpConn::proxy(ISrsHttpResponseWriter* w, SrsHttpMessage* r, std:
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = do_proxy(rr, &dec);
|
||||
close();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsDynamicHttpConn::do_proxy(ISrsHttpResponseReader* rr, SrsFlvDecoder* dec)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
char pps[4];
|
||||
while (!rr->eof()) {
|
||||
pprint->elapse();
|
||||
|
||||
|
@ -185,7 +196,7 @@ int SrsDynamicHttpConn::proxy(ISrsHttpResponseWriter* w, SrsHttpMessage* r, std:
|
|||
char type;
|
||||
int32_t size;
|
||||
u_int32_t time;
|
||||
if ((ret = dec.read_tag_header(&type, &size, &time)) != ERROR_SUCCESS) {
|
||||
if ((ret = dec->read_tag_header(&type, &size, &time)) != ERROR_SUCCESS) {
|
||||
if (!srs_is_client_gracefully_close(ret)) {
|
||||
srs_error("flv: proxy tag header failed. ret=%d", ret);
|
||||
}
|
||||
|
@ -193,7 +204,7 @@ int SrsDynamicHttpConn::proxy(ISrsHttpResponseWriter* w, SrsHttpMessage* r, std:
|
|||
}
|
||||
|
||||
char* data = new char[size];
|
||||
if ((ret = dec.read_tag_data(data, size)) != ERROR_SUCCESS) {
|
||||
if ((ret = dec->read_tag_data(data, size)) != ERROR_SUCCESS) {
|
||||
srs_freep(data);
|
||||
if (!srs_is_client_gracefully_close(ret)) {
|
||||
srs_error("flv: proxy tag data failed. ret=%d", ret);
|
||||
|
@ -208,7 +219,7 @@ int SrsDynamicHttpConn::proxy(ISrsHttpResponseWriter* w, SrsHttpMessage* r, std:
|
|||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = dec.read_previous_tag_size(pps)) != ERROR_SUCCESS) {
|
||||
if ((ret = dec->read_previous_tag_size(pps)) != ERROR_SUCCESS) {
|
||||
if (!srs_is_client_gracefully_close(ret)) {
|
||||
srs_error("flv: proxy tag header pps failed. ret=%d", ret);
|
||||
}
|
||||
|
|
|
@ -42,6 +42,8 @@ class SrsRtmpClient;
|
|||
class SrsStSocket;
|
||||
class SrsRequest;
|
||||
class SrsPithyPrint;
|
||||
class ISrsHttpResponseReader;
|
||||
class SrsFlvDecoder;
|
||||
|
||||
#include <srs_app_st.hpp>
|
||||
#include <srs_app_listener.hpp>
|
||||
|
@ -98,6 +100,7 @@ public:
|
|||
public:
|
||||
virtual int proxy(ISrsHttpResponseWriter* w, SrsHttpMessage* r, std::string o);
|
||||
private:
|
||||
virtual int do_proxy(ISrsHttpResponseReader* rr, SrsFlvDecoder* dec);
|
||||
virtual int rtmp_write_packet(char type, u_int32_t timestamp, char* data, int size);
|
||||
private:
|
||||
// connect to rtmp output url.
|
||||
|
|
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
// current release version
|
||||
#define VERSION_MAJOR 2
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 161
|
||||
#define VERSION_REVISION 162
|
||||
|
||||
// server info.
|
||||
#define RTMP_SIG_SRS_KEY "SRS"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue