• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 #ifndef PVMF_PROTOCOL_ENGINE_NODE_TUNABLES_H_INCLUDED
19 #define PVMF_PROTOCOL_ENGINE_NODE_TUNABLES_H_INCLUDED
20 
21 #define PDL_HTTP_USER_AGENT         _STRLIT_CHAR("PVPLAYER 04.07.00.01")
22 #define PDL_HTTP_VERSION_NUMBER     0 // 0 => Http Version1.0 ; 1 => Http Version1.1
23 
24 // macros for memory pool
25 #define PVHTTPDOWNLOADOUTPUT_CONTENTDATA_POOLNUM 16
26 #define PVHTTPSTREAMINGOUTPUT_CONTENTDATA_POOLNUM 1024
27 #define PVHTTPDOWNLOADOUTPUT_MEDIADATA_CHUNKSIZE 128
28 #ifndef PVHTTPDOWNLOADOUTPUT_CONTENTDATA_CHUNKSIZE
29 #define PVHTTPDOWNLOADOUTPUT_CONTENTDATA_CHUNKSIZE 8000
30 #endif
31 
32 // macros for timer
33 #define DEFAULT_MAX_SERVER_INACTIVITY_DURATION_IN_SEC 60
34 #define DEFAULT_MAX_SERVER_RESPONSE_DURATION_IN_SEC 60
35 #define DEFAULT_KEEPALIVE_TIMEOUT_IN_SEC 60
36 #define DEFAULT_MAX_SERVER_RESPONSE_DURATION_IN_SEC_FOR_STOPEOS_LOGGING 4
37 #define DEFAULT_WALLCLOCK_TIMEOUT_IN_SEC 2
38 #define DEFAULT_BUFFER_STATUS_CLOCK_TIMEOUT_IN_SEC 2
39 #define DEFAULT_TIMER_VECTOR_RESERVE_NUMBER 8
40 #define PVPROTOCOLENGINENODE_TIMER_FREQUENCY 1 // 1 means 1 sec, 1000 means 1msec
41 
42 // bitmask for http method for extension header
43 #define BITMASK_HTTPGET 1
44 #define BITMASK_HTTPPOST 2
45 #define BITMASK_HTTPHEAD 4
46 
47 // macros for user-agent
48 #define DEFAULT_DL_USER_AGNET           _STRLIT_CHAR("PVPlayer/4.0 (Beta release)")
49 #define DEFAULT_MS_STREAMING_USER_AGENT _STRLIT_CHAR("NSPlayer/10.0.0.3646")
50 
51 // marcos for download algorithm pre-condition checks
52 #define PVPROTOCOLENGINE_INIT_DOWNLOAD_TIME_THRESHOLD  1000 // 1000msec
53 #define PVPROTOCOLENGINE_INIT_DOWNLOAD_SIZE_PERCENTAGE_THRESHOLD  10 // 10% of file size
54 #define PVPROTOCOLENGINE_INIT_DOWNLOAD_SIZE_THRESHOLD  4096 // 4Kbytes
55 #define PVPROTOCOLENGINE_INIT_DOWNLOAD_TIME_THRESHOLD_WITH_CLIPBITRATE  10 // 10sec
56 #define PVPROTOCOLENGINE_JITTER_BUFFER_SIZE_BYTES  10240 // 10Kbytes
57 #define PVPROTOCOLENGINE_JITTER_BUFFER_SIZE_TIME   4    // 4sec worth of data
58 #define PVPROTOCOLENGINE_JITTER_BUFFER_SIZE_DLPERCENTAGE   15   // 15% of file size
59 
60 // marcos for the fixed-point calculation in auto-resume decision
61 #define PVPROTOCOLENGINE_AUTO_RESUME_FIXED_CALCULATION_MAX_LIMIT_RIGHT_SHIFT_FACTOR  16 // 2^16=65536
62 #define PVPROTOCOLENGINE_AUTO_RESUME_FIXED_CALCULATION_RIGHT_SHIFT 10
63 
64 // macros for download byte percentage calculation: downloadSize*100/fileSize
65 #define PVPROTOCOLENGINE_DOWNLOAD_BYTE_PERCENTAGE_CONVERTION_100 100 // 100
66 #define PVPROTOCOLENGINE_DOWNLOAD_BYTE_PERCENTAGE_DLSIZE_LIMIT_RIGHT_SHIFT_FACTOR   25 //2^25 =33554432 // 33554432 = 2^32 / 2^7 = 2^25
67 #define PVPROTOCOLENGINE_DOWNLOAD_BYTE_PERCENTAGE_DLSIZE_RIGHTSHIFT_FACTOR 7 // right shift 7 bits, 2^7 > 100
68 #define PVPROTOCOLENGINE_MINIMAL_BUFFERING_TIME_FOR_FASTTRACK  7000     // 7000msec
69 
70 // macros for duration calcuation: fileSize*1000/playback rate
71 #define PVPROTOCOLENGINE_DOWNLOAD_DURATION_CALCULATION_LIMIT_RIGHT_SHIFT_FACTOR   22 //2^21 =4194304
72 #define PVPROTOCOLENGINE_DOWNLOAD_DURATION_CALCULATION_RIGHTSHIFT_FACTOR 10 // right shift 7 bits, 2^7 > 100
73 
74 
75 
76 // macros for misc stuff
77 #define PVPROTOCOLENGINE_RESERVED_NUMBER_OF_FRAMES 4
78 #define PROTOCOLENGINENODE_SPACE_ASCIICODE 0x20
79 #define BUFFER_SIZE_FOR_ZERO_OUT_DATA_STREAM_OBJECT 10240
80 #ifndef EVENT_HANDLER_TOTAL
81 #define EVENT_HANDLER_TOTAL 9
82 #endif
83 
84 #endif // PVMF_PROTOCOL_ENGINE_NODE_TUNABLES_H_INCLUDED
85 
86