Skip to content

Commit

Permalink
* optimize rtmp
Browse files Browse the repository at this point in the history
  • Loading branch information
lxowalle committed May 15, 2024
1 parent 9e4c6e4 commit f138216
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions components/vision/include/maix_rtmp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#include <stdexcept>
#include <pthread.h>

namespace maix {
namespace maix::rtmp
{
/**
* Rtmp class
* @maixpy maix.rtmp.Rtmp
Expand Down Expand Up @@ -116,7 +117,7 @@ namespace maix {

/**
* @brief Get the file path of the push stream
* @return error code, err::ERR_NONE means success, others means failed
* @return file path
* @maixpy maix.rtmp.Rtmp.get_path
*/
std::string get_path() {
Expand All @@ -125,7 +126,7 @@ namespace maix {

/**
* @brief Check whether push streaming has started
* @return error code, err::ERR_NONE means success, others means failed
* @return If rtmp thread is running, returns true
* @maixpy maix.rtmp.Rtmp.get_path
*/
bool is_started() {
Expand Down
2 changes: 1 addition & 1 deletion components/vision/port/maixcam/maix_rtmp_maixcam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static int rtmp_client_send(void* param, const void* header, size_t len, const v
return socket_send_v_all_by_time(*socket, vec, bytes > 0 ? 2 : 1, 0, 5000);
}

namespace maix {
namespace maix::rtmp {
Rtmp::Rtmp(std::string host, int port, std::string app, std::string stream) {
_host = host;
_port = port;
Expand Down
2 changes: 1 addition & 1 deletion examples/rtmp_demo/main/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int _main(int argc, char* argv[])
std::string file = argv[5];
printf("push %s to rtmp://%s:%d/%s/%s!\r\n", &file[0], &host[0], port, &app[0], &stream[0]);

Rtmp rtmp = Rtmp(host, port, app, stream);
rtmp::Rtmp rtmp = rtmp::Rtmp(host, port, app, stream);

log::info("start\r\n");
rtmp.start(file);
Expand Down

0 comments on commit f138216

Please sign in to comment.