winlin

refine config, add comments

@@ -2549,17 +2549,17 @@ int SrsConfig::get_dvr_time_jitter(string vhost) @@ -2549,17 +2549,17 @@ int SrsConfig::get_dvr_time_jitter(string vhost)
2549 return _srs_time_jitter_string2int(time_jitter); 2549 return _srs_time_jitter_string2int(time_jitter);
2550 } 2550 }
2551 2551
2552 -SrsConfDirective* SrsConfig::get_http_api()  
2553 -{  
2554 - return root->get("http_api");  
2555 -}  
2556 -  
2557 bool SrsConfig::get_http_api_enabled() 2552 bool SrsConfig::get_http_api_enabled()
2558 { 2553 {
2559 SrsConfDirective* conf = get_http_api(); 2554 SrsConfDirective* conf = get_http_api();
2560 return get_http_api_enabled(conf); 2555 return get_http_api_enabled(conf);
2561 } 2556 }
2562 2557
  2558 +SrsConfDirective* SrsConfig::get_http_api()
  2559 +{
  2560 + return root->get("http_api");
  2561 +}
  2562 +
2563 bool SrsConfig::get_http_api_enabled(SrsConfDirective* conf) 2563 bool SrsConfig::get_http_api_enabled(SrsConfDirective* conf)
2564 { 2564 {
2565 if (!conf) { 2565 if (!conf) {
@@ -2590,17 +2590,17 @@ int SrsConfig::get_http_api_listen() @@ -2590,17 +2590,17 @@ int SrsConfig::get_http_api_listen()
2590 return ::atoi(conf->arg0().c_str()); 2590 return ::atoi(conf->arg0().c_str());
2591 } 2591 }
2592 2592
2593 -SrsConfDirective* SrsConfig::get_http_stream()  
2594 -{  
2595 - return root->get("http_stream");  
2596 -}  
2597 -  
2598 bool SrsConfig::get_http_stream_enabled() 2593 bool SrsConfig::get_http_stream_enabled()
2599 { 2594 {
2600 SrsConfDirective* conf = get_http_stream(); 2595 SrsConfDirective* conf = get_http_stream();
2601 return get_http_stream_enabled(conf); 2596 return get_http_stream_enabled(conf);
2602 } 2597 }
2603 2598
  2599 +SrsConfDirective* SrsConfig::get_http_stream()
  2600 +{
  2601 + return root->get("http_stream");
  2602 +}
  2603 +
2604 bool SrsConfig::get_http_stream_enabled(SrsConfDirective* conf) 2604 bool SrsConfig::get_http_stream_enabled(SrsConfDirective* conf)
2605 { 2605 {
2606 if (!conf) { 2606 if (!conf) {
@@ -712,159 +712,171 @@ public: @@ -712,159 +712,171 @@ public:
712 // log section 712 // log section
713 public: 713 public:
714 /** 714 /**
715 - * 715 + * whether log to file.
716 */ 716 */
717 virtual bool get_log_tank_file(); 717 virtual bool get_log_tank_file();
718 /** 718 /**
719 - * 719 + * get the log level.
720 */ 720 */
721 virtual std::string get_log_level(); 721 virtual std::string get_log_level();
722 /** 722 /**
723 - * 723 + * get the log file path.
724 */ 724 */
725 virtual std::string get_log_file(); 725 virtual std::string get_log_file();
726 /** 726 /**
727 - * 727 + * whether ffmpeg log enabled
728 */ 728 */
729 virtual bool get_ffmpeg_log_enabled(); 729 virtual bool get_ffmpeg_log_enabled();
730 /** 730 /**
731 - * 731 + * the ffmpeg log dir.
  732 + * @remark, /dev/null to disable it.
732 */ 733 */
733 virtual std::string get_ffmpeg_log_dir(); 734 virtual std::string get_ffmpeg_log_dir();
734 // hls section 735 // hls section
735 private: 736 private:
736 /** 737 /**
737 - * 738 + * get the hls directive of vhost.
738 */ 739 */
739 virtual SrsConfDirective* get_hls(std::string vhost); 740 virtual SrsConfDirective* get_hls(std::string vhost);
740 public: 741 public:
741 /** 742 /**
742 - * 743 + * whether HLS is enabled.
743 */ 744 */
744 virtual bool get_hls_enabled(std::string vhost); 745 virtual bool get_hls_enabled(std::string vhost);
745 /** 746 /**
746 - * 747 + * get the HLS ts/m3u8 file store path.
747 */ 748 */
748 virtual std::string get_hls_path(std::string vhost); 749 virtual std::string get_hls_path(std::string vhost);
749 /** 750 /**
750 - * 751 + * get the hls fragment time, in seconds.
  752 + * a fragment is a ts file.
751 */ 753 */
752 virtual double get_hls_fragment(std::string vhost); 754 virtual double get_hls_fragment(std::string vhost);
753 /** 755 /**
754 - * 756 + * get the hls window time, in seconds.
  757 + * a window is a set of ts, the ts collection in m3u8.
  758 + * @remark SRS will delete the ts exceed the window.
755 */ 759 */
756 virtual double get_hls_window(std::string vhost); 760 virtual double get_hls_window(std::string vhost);
757 // dvr section 761 // dvr section
758 private: 762 private:
759 /** 763 /**
760 - * 764 + * get the dvr directive.
761 */ 765 */
762 virtual SrsConfDirective* get_dvr(std::string vhost); 766 virtual SrsConfDirective* get_dvr(std::string vhost);
763 public: 767 public:
764 /** 768 /**
765 - * 769 + * whether dvr is enabled.
766 */ 770 */
767 virtual bool get_dvr_enabled(std::string vhost); 771 virtual bool get_dvr_enabled(std::string vhost);
768 /** 772 /**
769 - * 773 + * get the dvr path, the flv file to save in.
770 */ 774 */
771 virtual std::string get_dvr_path(std::string vhost); 775 virtual std::string get_dvr_path(std::string vhost);
772 /** 776 /**
773 - * 777 + * get the plan of dvr, how to reap the flv file.
774 */ 778 */
775 virtual std::string get_dvr_plan(std::string vhost); 779 virtual std::string get_dvr_plan(std::string vhost);
776 /** 780 /**
777 - * 781 + * get the duration of dvr flv, for segment plan.
778 */ 782 */
779 virtual int get_dvr_duration(std::string vhost); 783 virtual int get_dvr_duration(std::string vhost);
780 /** 784 /**
781 - * 785 + * get the time_jitter algorithm for dvr.
782 */ 786 */
783 virtual int get_dvr_time_jitter(std::string vhost); 787 virtual int get_dvr_time_jitter(std::string vhost);
784 // http api section 788 // http api section
785 private: 789 private:
786 /** 790 /**
787 - * 791 + * get the http api directive.
788 */ 792 */
789 virtual SrsConfDirective* get_http_api(); 793 virtual SrsConfDirective* get_http_api();
790 -public:  
791 /** 794 /**
792 - * 795 + * whether http api enabled
793 */ 796 */
794 - virtual bool get_http_api_enabled(); 797 + virtual bool get_http_api_enabled(SrsConfDirective* conf);
  798 +public:
795 /** 799 /**
796 - * 800 + * whether http api enabled.
797 */ 801 */
798 - virtual bool get_http_api_enabled(SrsConfDirective* conf); 802 + virtual bool get_http_api_enabled();
799 /** 803 /**
800 - * 804 + * get the http api listen port.
801 */ 805 */
802 virtual int get_http_api_listen(); 806 virtual int get_http_api_listen();
803 // http stream section 807 // http stream section
804 private: 808 private:
805 /** 809 /**
806 - * 810 + * get the http stream directive.
807 */ 811 */
808 virtual SrsConfDirective* get_http_stream(); 812 virtual SrsConfDirective* get_http_stream();
809 -public:  
810 /** 813 /**
811 - * 814 + * whether http stream enabled.
812 */ 815 */
813 - virtual bool get_http_stream_enabled(); 816 + virtual bool get_http_stream_enabled(SrsConfDirective* conf);
  817 +public:
814 /** 818 /**
815 - * 819 + * whether http stream enabled.
816 */ 820 */
817 - virtual bool get_http_stream_enabled(SrsConfDirective* conf); 821 + virtual bool get_http_stream_enabled();
818 /** 822 /**
819 - * 823 + * get the http stream listen port.
820 */ 824 */
821 virtual int get_http_stream_listen(); 825 virtual int get_http_stream_listen();
822 /** 826 /**
823 - * 827 + * get the http stream root dir.
824 */ 828 */
825 virtual std::string get_http_stream_dir(); 829 virtual std::string get_http_stream_dir();
826 public: 830 public:
827 /** 831 /**
828 - * 832 + * get whether vhost enabled http stream
829 */ 833 */
830 virtual bool get_vhost_http_enabled(std::string vhost); 834 virtual bool get_vhost_http_enabled(std::string vhost);
831 /** 835 /**
832 - * 836 + * get the http mount point for vhost,
  837 + * vhost can use sub dir of http.
  838 + * for example, http://server/vhost1/live/livestream
  839 + * where the vhost1 is mount point for vhost1.
833 */ 840 */
834 virtual std::string get_vhost_http_mount(std::string vhost); 841 virtual std::string get_vhost_http_mount(std::string vhost);
835 /** 842 /**
836 - * 843 + * get the http dir for vhost.
  844 + * the http dir of vhost will mount to the mount point of vhost.
  845 + * for example, http://server/vhost1/live/livestream
  846 + * where the vhost1 is mount point for vhost1,
  847 + * and vhost1 dir is specified by this http dir.
837 */ 848 */
838 virtual std::string get_vhost_http_dir(std::string vhost); 849 virtual std::string get_vhost_http_dir(std::string vhost);
839 // http heartbeart section 850 // http heartbeart section
840 private: 851 private:
841 /** 852 /**
842 - * 853 + * get the heartbeat directive.
843 */ 854 */
844 virtual SrsConfDirective* get_heartbeart(); 855 virtual SrsConfDirective* get_heartbeart();
845 public: 856 public:
846 /** 857 /**
847 - * 858 + * whether heartbeat enabled.
848 */ 859 */
849 virtual bool get_heartbeat_enabled(); 860 virtual bool get_heartbeat_enabled();
850 /** 861 /**
851 - * 862 + * get the heartbeat interval, in ms.
852 */ 863 */
853 virtual int64_t get_heartbeat_interval(); 864 virtual int64_t get_heartbeat_interval();
854 /** 865 /**
855 - * 866 + * get the heartbeat report url.
856 */ 867 */
857 virtual std::string get_heartbeat_url(); 868 virtual std::string get_heartbeat_url();
858 /** 869 /**
859 - * 870 + * get the device id of heartbeat, to report to server.
860 */ 871 */
861 virtual std::string get_heartbeat_device_id(); 872 virtual std::string get_heartbeat_device_id();
862 /** 873 /**
863 - * 874 + * get the network device index, to report to server.
  875 + * for example, 0 means the eth0 maybe.
864 */ 876 */
865 virtual int get_heartbeat_device_index(); 877 virtual int get_heartbeat_device_index();
866 /** 878 /**
867 - * 879 + * whether report with summaries of http api: /api/v1/summaries.
868 */ 880 */
869 virtual bool get_heartbeat_summaries(); 881 virtual bool get_heartbeat_summaries();
870 }; 882 };
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 // current release version 31 // current release version
32 #define VERSION_MAJOR "0" 32 #define VERSION_MAJOR "0"
33 #define VERSION_MINOR "9" 33 #define VERSION_MINOR "9"
34 -#define VERSION_REVISION "161" 34 +#define VERSION_REVISION "162"
35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION 35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
36 // server info. 36 // server info.
37 #define RTMP_SIG_SRS_KEY "SRS" 37 #define RTMP_SIG_SRS_KEY "SRS"