mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	* change default multicast address
* fix timestamp calculation git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@715 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									71227de8b2
								
							
						
					
					
						commit
						1fec416db7
					
				
					 3 changed files with 9 additions and 8 deletions
				
			
		| 
						 | 
					@ -61,9 +61,9 @@ PA_MODULE_USAGE(
 | 
				
			||||||
        "mtu=<maximum transfer unit> "
 | 
					        "mtu=<maximum transfer unit> "
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define DEFAULT_PORT 5666
 | 
					#define DEFAULT_PORT 5004
 | 
				
			||||||
#define SAP_PORT 9875
 | 
					#define SAP_PORT 9875
 | 
				
			||||||
#define DEFAULT_DESTINATION "224.0.0.252"
 | 
					#define DEFAULT_DESTINATION "224.0.1.2"
 | 
				
			||||||
#define MEMBLOCKQ_MAXLENGTH (1024*170)
 | 
					#define MEMBLOCKQ_MAXLENGTH (1024*170)
 | 
				
			||||||
#define DEFAULT_MTU 1024
 | 
					#define DEFAULT_MTU 1024
 | 
				
			||||||
#define SAP_INTERVAL 5000000
 | 
					#define SAP_INTERVAL 5000000
 | 
				
			||||||
| 
						 | 
					@ -136,7 +136,6 @@ static void sap_event(pa_mainloop_api *m, pa_time_event *t, const struct timeval
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_sap_send(&u->sap_context, 0);
 | 
					    pa_sap_send(&u->sap_context, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_log("SAP update");
 | 
					 | 
				
			||||||
    pa_gettimeofday(&next);
 | 
					    pa_gettimeofday(&next);
 | 
				
			||||||
    pa_timeval_add(&next, SAP_INTERVAL);
 | 
					    pa_timeval_add(&next, SAP_INTERVAL);
 | 
				
			||||||
    m->time_restart(t, &next);
 | 
					    m->time_restart(t, &next);
 | 
				
			||||||
| 
						 | 
					@ -280,7 +279,7 @@ int pa__init(pa_core *c, pa_module*m) {
 | 
				
			||||||
                     af == AF_INET ? (void*) &sa4.sin_addr : (void*) &sa6.sin6_addr,
 | 
					                     af == AF_INET ? (void*) &sa4.sin_addr : (void*) &sa6.sin6_addr,
 | 
				
			||||||
                     "Polypaudio RTP Stream", port, payload, &ss);
 | 
					                     "Polypaudio RTP Stream", port, payload, &ss);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    pa_rtp_context_init_send(&u->rtp_context, fd, 0, payload);
 | 
					    pa_rtp_context_init_send(&u->rtp_context, fd, 0, payload, pa_frame_size(&ss));
 | 
				
			||||||
    pa_sap_context_init_send(&u->sap_context, sap_fd, p);
 | 
					    pa_sap_context_init_send(&u->sap_context, sap_fd, p);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_log_info("RTP stream initialized with mtu %u on %s:%u, SSRC=0x%08x, payload=%u, initial sequence #%u", mtu, dest, port, u->rtp_context.ssrc, payload, u->rtp_context.sequence);
 | 
					    pa_log_info("RTP stream initialized with mtu %u on %s:%u, SSRC=0x%08x, payload=%u, initial sequence #%u", mtu, dest, port, u->rtp_context.ssrc, payload, u->rtp_context.sequence);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "rtp.h"
 | 
					#include "rtp.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pa_rtp_context* pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssrc, uint8_t payload) {
 | 
					pa_rtp_context* pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssrc, uint8_t payload, size_t frame_size) {
 | 
				
			||||||
    assert(c);
 | 
					    assert(c);
 | 
				
			||||||
    assert(fd >= 0);
 | 
					    assert(fd >= 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -44,6 +44,7 @@ pa_rtp_context* pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssr
 | 
				
			||||||
    c->timestamp = 0;
 | 
					    c->timestamp = 0;
 | 
				
			||||||
    c->ssrc = ssrc ? ssrc : (uint32_t) (rand()*rand());
 | 
					    c->ssrc = ssrc ? ssrc : (uint32_t) (rand()*rand());
 | 
				
			||||||
    c->payload = payload & 127;
 | 
					    c->payload = payload & 127;
 | 
				
			||||||
 | 
					    c->frame_size = frame_size;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    return c;
 | 
					    return c;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -114,7 +115,7 @@ int pa_rtp_send(pa_rtp_context *c, size_t size, pa_memblockq *q) {
 | 
				
			||||||
            } else
 | 
					            } else
 | 
				
			||||||
                k = 0;
 | 
					                k = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            c->timestamp += skip;
 | 
					            c->timestamp += skip/c->frame_size;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            if (k < 0) {
 | 
					            if (k < 0) {
 | 
				
			||||||
                if (errno != EAGAIN) /* If the queue is full, just ignore it */
 | 
					                if (errno != EAGAIN) /* If the queue is full, just ignore it */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,9 +34,10 @@ typedef struct pa_rtp_context {
 | 
				
			||||||
    uint32_t timestamp;
 | 
					    uint32_t timestamp;
 | 
				
			||||||
    uint32_t ssrc;
 | 
					    uint32_t ssrc;
 | 
				
			||||||
    uint8_t payload;
 | 
					    uint8_t payload;
 | 
				
			||||||
 | 
					    size_t frame_size;
 | 
				
			||||||
} pa_rtp_context;
 | 
					} pa_rtp_context;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pa_rtp_context* pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssrc, uint8_t payload);
 | 
					pa_rtp_context* pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssrc, uint8_t payload, size_t frame_size);
 | 
				
			||||||
int pa_rtp_send(pa_rtp_context *c, size_t size, pa_memblockq *q);
 | 
					int pa_rtp_send(pa_rtp_context *c, size_t size, pa_memblockq *q);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pa_rtp_context* pa_rtp_context_init_recv(pa_rtp_context *c, int fd);
 | 
					pa_rtp_context* pa_rtp_context_init_recv(pa_rtp_context *c, int fd);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue