buffer

Android Show image while video is buffering?

I have an app that displays a video using VideoView. The layout consists of a Clock and a VideoView laid out in a simple vertical LinearLayout. Here's my code snippet that I use: VideoView mVideoView = new VideoView(this); mVideoView.setVideoPath(myVideoURL); mVideoView.requestFocus(); mVideoView.start(); Since the buffering of the vi...

How do I get the size of the boost buffer

I am trying to make an asynchronised server in visual studio and I use boost::asio::async_read(m_socket, boost::asio::buffer(m_buffer), boost::bind(&tcp_connection::handle_read, shared_from_this(), boost::asio::placeholders::error)); to get the buffer to be put in m_buffer ...

Check if song is buffering in AS3

I have the following piece of code: var song:Sound; var sndChannel:SoundChannel; var context:SoundLoaderContext = new SoundLoaderContext(2000); function songLoad():void { song.load(new URLRequest(songs[selected]),context); sndChannel = song.play(); } Now I want to be able to check if the song is buffering or not. Is there a w...

How get 0 and -1 in printf (buffer)? in audio recording iphone

Hi, here's my problem at hand: I need to analyze audio data in realtime to find out the amplitude of the signal I can't use the AudioQueue metering functionality because it has too much delay for detecting peaks I have studied the aurioTouch example..... however... I simply don't understand how the PCM coded buffer is converted back to...

How get raw data in printf (buffer)? in audio recording iphone

I need raw data like 0 / 1 static OSStatus recordingCallback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, // AudioQueueBufferRef inBuffer, const AudioTimeStamp *inTimeStamp, UInt32 inBu...

What is the magic behind perl read() function and buffer which is not a ref ?

I do not get to understand how the Perl read($buf) function is able to modify the content of the $buf variable. $buf is not a reference, so the parameter is given by copy (from my c/c++ knowledge). So how come the $buf variable is modified in the caller ? Is it a tie variable or something ? The C documentation about setbuf is also quit...

boost::asio buffer impossible to convert parameter from char to const mutable_buffer&

visual studio tells me "error C2664: 'boost::asio::mutable_buffer::mutable_buffer(const boost::asio::mutable_buffer&)': impossible to convert parameter 1 from 'char' to 'const boost::asio::mutable_buffer&' at line 163 of consuming_buffers.hpp" I am unsure of why this happen nor how to solve it(otherwise I wouldn't ask this ^^') but I th...

Buffer management for socket application best practice

Having a Windows IOCP app............ I understand that for async i/o operation (on network) the buffer must remain valid for the duration of the send/read operation. So for each connection I have one buffer for the reading. For sending I use buffers to which I copy the data to be sent. When the sending operation completes I release th...

File IO with Streams - Best Memory Buffer Size

I am writing a small IO library to assist with a larger (hobby) project. A part of this library performs various functions on a file, which is read / written via the FileStream object. On each StreamReader.Read(...) pass, I fire off an event which will be used in the main app to display progress information. The processing that goes on i...

Limiting TCP sends with a "to-be-sent" queue and other design issues.

Hello all! This question is the result of two other questions I've asked in the last few days. I'm creating a new question because I think it's related to the "next step" in my understanding of how to control the flow of my send/receive, something I didn't get a full answer to yet. The other related questions are: http://stackoverflow.c...

check if current emacs buffer contains a string

I have a buffer open in emacs. I want a function that will return t if the current buffer contains the string, otherwise it returns nil. (defun buffer-contains-substring (string) ... ) ...

buffer overrun throw return address

Hi, When I throw in a method A, it causes buffer overrun but when I return, it runs fine. I thought throw moves execution to the caller method so the address it goes to should be the same as return address, but i am obviuosly wrong. Is there a way to see what address throw goes to in Visual Studio debugger? Thank you Berkus: does this ...

How do you flush a buffered log4j FileAppender?

In log4j, when using a FileAppender with BufferedIO=true and BufferSize=xxx properties (i.e. buffering is enabled), I want to be able to flush the log during normal shutdown procedure. Any ideas on how to do this? ...

reading buffer from socket

I'm writing simple server/client in c, where server temporary stores message from client and retrieve it when client request it. The problem is when client receives message from server, the buffer acts kinda weird. All i did is read as much as receive from server and print it on the screen, but somehow buffer was overwrited more than ma...

Java: CharBuffer "ignores" array offset?

Hello, everyone! Please help me understand the following: I create a CharBuffer using CharBuffer.wrapped(new char[12], 2, 10) (array, offset, length) so I would expect that the array is accessed with an offset of 2 and total (rest) length of 10. But arrayOffset() returns 0. What I want to understand (and can't figure out from JavaDoc)...

looking for a MemoryStream in C++

In the wonderful world of C# i can create a memory stream without specifying its size, write into it and then just take the underlying buffer. How can i do the same in c++? basicly i need to do: memory_stream ms(GROW_AS_MUCH_AS_YOU_LIKE); ms << someLargeObjects << someSmallObjects << someObjectsWhosSizeIDontKnow; unsigned char* buff...

image buffer implementation in delphi

Context I am drawing to a canvas, this is updated regularly and it flashes. Logically thinking I assumed this is because my redraw method clears the Canvas then draws one element at a time to the canvas. so my idea was to write to a Timage then set the picture to the Timage. Information here is my code procedure Tmainwindow.Button3...

Protocol Buffer and UTF16 Unicode.

How do you use Google Protocol Buffer with UTF16 Unicode? ...

How to set Emacs gdb so that it shows recent command on arrow-up?

How can I set Emacs gdb so that it shows the most recent command when I press arrow-up? In the Emacs gdb it will just go one line up in the buffer. I know you can always just search backwards in the buffer and select a recent command there, but getting the command directly with arrow-up would be more convenient. ...

How do I make php handle file downloads of incomplete file?

So for example, I have a file being uploaded through ftp and file size changes. I do know the file size beforehand. So how would I make php to send it to clients browsers even if file is not finished uploading and waiting for file size to match before it finish buffering. The code below won't update the handle and doesn't see changes mad...