mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add comments for file stream
This commit is contained in:
parent
a63fa20e53
commit
996d042a33
4 changed files with 12 additions and 0 deletions
|
@ -104,6 +104,7 @@ int SrsFileBuffer::fullfill(const char* filename)
|
||||||
int nread = 0;
|
int nread = 0;
|
||||||
int filesize = 0;
|
int filesize = 0;
|
||||||
|
|
||||||
|
// TODO: FIXME: refine the file stream.
|
||||||
if ((fd = ::open(filename, O_RDONLY, 0)) < 0) {
|
if ((fd = ::open(filename, O_RDONLY, 0)) < 0) {
|
||||||
ret = ERROR_SYSTEM_CONFIG_INVALID;
|
ret = ERROR_SYSTEM_CONFIG_INVALID;
|
||||||
srs_error("open conf file error. ret=%d", ret);
|
srs_error("open conf file error. ret=%d", ret);
|
||||||
|
|
|
@ -36,6 +36,13 @@ class SrsRequest;
|
||||||
class SrsAmf0Object;
|
class SrsAmf0Object;
|
||||||
class SrsSharedPtrMessage;
|
class SrsSharedPtrMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* encode data to flv file.
|
||||||
|
*/
|
||||||
|
class SrsFlvEncoder
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dvr(digital video recorder) to record RTMP stream to flv file.
|
* dvr(digital video recorder) to record RTMP stream to flv file.
|
||||||
* TODO: FIXME: add utest for it.
|
* TODO: FIXME: add utest for it.
|
||||||
|
|
|
@ -152,6 +152,7 @@ public:
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
// TODO: FIXME: maybe should use st_write.
|
||||||
if (::write(fd, mpegts_header, sizeof(mpegts_header)) != sizeof(mpegts_header)) {
|
if (::write(fd, mpegts_header, sizeof(mpegts_header)) != sizeof(mpegts_header)) {
|
||||||
ret = ERROR_HLS_WRITE_FAILED;
|
ret = ERROR_HLS_WRITE_FAILED;
|
||||||
srs_error("write ts file header failed. ret=%d", ret);
|
srs_error("write ts file header failed. ret=%d", ret);
|
||||||
|
@ -276,6 +277,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// write ts packet
|
// write ts packet
|
||||||
|
// TODO: FIXME: maybe should use st_write.
|
||||||
if (::write(fd, packet, sizeof(packet)) != sizeof(packet)) {
|
if (::write(fd, packet, sizeof(packet)) != sizeof(packet)) {
|
||||||
ret = ERROR_HLS_WRITE_FAILED;
|
ret = ERROR_HLS_WRITE_FAILED;
|
||||||
srs_error("write ts file failed. ret=%d", ret);
|
srs_error("write ts file failed. ret=%d", ret);
|
||||||
|
@ -428,6 +430,7 @@ int SrsTSMuxer::open(string _path)
|
||||||
|
|
||||||
int flags = O_CREAT|O_WRONLY|O_TRUNC;
|
int flags = O_CREAT|O_WRONLY|O_TRUNC;
|
||||||
mode_t mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH;
|
mode_t mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH;
|
||||||
|
// TODO: FIXME: refine the file stream.
|
||||||
if ((fd = ::open(path.c_str(), flags, mode)) < 0) {
|
if ((fd = ::open(path.c_str(), flags, mode)) < 0) {
|
||||||
ret = ERROR_HLS_OPEN_FAILED;
|
ret = ERROR_HLS_OPEN_FAILED;
|
||||||
srs_error("open ts file %s failed. ret=%d", path.c_str(), ret);
|
srs_error("open ts file %s failed. ret=%d", path.c_str(), ret);
|
||||||
|
|
|
@ -163,6 +163,7 @@ int SrsHttpVhost::do_process_request(SrsSocket* skt, SrsHttpMessage* req)
|
||||||
|
|
||||||
std::string fullpath = get_request_file(req);
|
std::string fullpath = get_request_file(req);
|
||||||
|
|
||||||
|
// TODO: FIXME: refine the file stream.
|
||||||
int fd = ::open(fullpath.c_str(), O_RDONLY);
|
int fd = ::open(fullpath.c_str(), O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
ret = ERROR_HTTP_OPEN_FILE;
|
ret = ERROR_HTTP_OPEN_FILE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue