• 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 /**
19  * @file pvmf_clientserver_socket_tuneables.h
20  */
21 
22 #ifndef PVMF_CLIENTSERVER_SOCKET_TUNEABLES_H_INCLUDED
23 #define PVMF_CLIENTSERVER_SOCKET_TUNEABLES_H_INCLUDED
24 
25 #ifndef OSCL_SOCKET_H_INCLUDED
26 #include "oscl_socket.h"
27 #endif
28 #ifndef PVMF_NODE_INTERFACE_H_INCLUDED
29 #include "pvmf_node_interface.h"
30 #endif
31 #ifndef PVMI_CONFIG_AND_CAPABILITY_UTILS_H_INCLUDED
32 #include "pvmi_config_and_capability_utils.h"
33 #endif
34 #ifndef OSCL_SCHEDULER_AO_H_INCLUDED
35 #include "oscl_scheduler_ao.h"
36 #endif
37 #ifndef OSCL_MEM_MEMPOOL_H_INCLUDED
38 #include "oscl_mem_mempool.h"
39 #endif
40 #ifndef PVMF_SIMPLE_MEDIA_BUFFER_H_INCLUDED
41 #include "pvmf_simple_media_buffer.h"
42 #endif
43 #ifndef PVMF_NODE_UTILS_H_INCLUDED
44 #include "pvmf_node_utils.h"
45 #endif
46 
47 
48 #define PVMFSocketNodeEventTypeUUID PVUuid(0xbe846567,0xae17,0x44c8,0x9c,0x9a,0x87,0xb8,0x33,0xa0,0xf9,0x1d)
49 
50 
51 #define DEFAULT_SOCKET_NODE_MEDIA_MSGS_NUM 1
52 #define PVMF_SOCKET_NODE_PORT_VECTOR_RESERVE 10
53 
54 const PVUid32 PVMF_MEDIA_CMD_SOCKET_CONNECT_FORMAT_ID    = 0x00000200;
55 const PVUid32 PVMF_MEDIA_CMD_SOCKET_DISCONNECT_FORMAT_ID = 0x00000201;
56 
57 #define SNODE_DEFAULT_SOCKET_TCP_BUFFER_SIZE        (4096)
58 #define SNODE_DEFAULT_MAX_TCP_RECV_BUFFER_SIZE      (4*1024)
59 
60 #define SNODE_DEFAULT_SOCKET_TCP_BUFFER_COUNT       8
61 #define SNODE_DEFAULT_NUMBER_MEDIADATA_IN_MEMPOOL   4
62 
63 #define MAX_SOCKET_BUFFER_SIZE                      (16*1024)
64 #define DEFAULT_MAX_NUM_SOCKETMEMPOOL_RESIZES        100
65 
66 #define DEFAULT_MAX_SOCKETMEMPOOL_RESIZELEN_FEEDBACK_PORT  32*1024
67 #define DEFAULT_MAX_SOCKETMEMPOOL_RESIZELEN_INPUT_PORT  \
68                 (32*1024 + 2*MAX_SOCKET_BUFFER_SIZE)
69 
70 #define MIN_SOCKETMEMPOOL_RESIZELEN_INPUT_PORT      0
71 #define MAX_SOCKETMEMPOOL_RESIZELEN_INPUT_PORT      128*1024
72 
73 /**
74  * An enumeration of error codes from PVMFSocketNode
75  **/
76 typedef enum
77 {
78     PVMFSocketNodeErrorEventStart = 1024,
79     PVMFSocketNodeErrorSocketServerCreateError,
80     PVMFSocketNodeErrorSocketServConnectError,
81     PVMFSocketNodeErrorTCPSocketRecvError,
82     PVMFSocketNodeErrorTCPSocketSendError,
83     PVMFSocketNodeError_TCPSocketConnect,
84     PVMFSocketNodeErrorSocketFailure,
85     PVMFSocketNodeErrorSocketTimeOut,
86     PVMFSocketNodeErrorInvalidPortTag,
87     PVMFSocketNodeErrorInvalidPortConfig,
88     PVMFSocketNodeErrorConnectCancelled,
89     PVMFSocketNodeErrorEventEnd
90 } PVMFSocketNodeErrorEventType;
91 
92 #endif  //PVMF_CLIENTSERVER_SOCKET_TUNEABLES_H_INCLUDED
93